Handle exit codes during version check

This commit is contained in:
Scott E. Graves
2019-06-06 17:11:31 -05:00
parent 0bbfddc17c
commit 4fa1c89df8
3 changed files with 10 additions and 3 deletions

View File

@@ -293,9 +293,10 @@ ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => {
.then(code => {
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
Valid: (code === 0),
Code: code,
});
})
.catch(e=> {
.catch(e => {
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
Valid: false,
}, e);

View File

@@ -6,7 +6,7 @@ import Button from '../../components/UI/Button/Button';
import ConfigurationItem from '../../components/ConfigurationItem/ConfigurationItem';
import Modal from '../../components/UI/Modal/Modal';
import IPCContainer from '../IPCContainer/IPCContainer';
import {displayConfiguration} from "../../redux/actions/mount_actions";
import {displayConfiguration} from '../../redux/actions/mount_actions';
const Constants = require('../../constants');

View File

@@ -125,7 +125,13 @@ class MountItems extends IPCContainer {
}
} else {
allowAction = false;
this.props.errorHandler("Incompatible " + provider + " daemon. Please upgrade " + provider);
if (result.Code === -1) {
this.props.errorHandler('Failed to connect to ' + provider + ' daemon');
} else if (result.Code === -3) {
this.props.errorHandler('Incompatible ' + provider + ' daemon. Please upgrade ' + provider);
} else {
this.props.errorHandler('Version check failed: ' + result.Error);
}
}
} else {
allowAction = false;