Fix - reports crashed if the user could not be switched (because mailtrain was not run under root). Now an error is reported.

This commit is contained in:
Tomas Bures 2017-04-27 18:14:15 -04:00
parent 2ac89f3365
commit 7a08ffa596
4 changed files with 52 additions and 13 deletions

View file

@ -30,6 +30,14 @@ function spawn(callback) {
requestCallback.startedCallback(msg.tid);
}
} else if (msg.type === 'process-failed') {
let requestCallback = requestCallbacks[msg.tid];
if (requestCallback && requestCallback.failedCallback) {
requestCallback.failedCallback(msg.msg);
}
delete requestCallbacks[msg.tid];
} else if (msg.type === 'process-finished') {
let requestCallback = requestCallbacks[msg.tid];
if (requestCallback && requestCallback.startedCallback) {
@ -50,10 +58,11 @@ function spawn(callback) {
});
}
function start(type, data, startedCallback, finishedCallback) {
function start(type, data, startedCallback, finishedCallback, failedCallback) {
requestCallbacks[messageTid] = {
startedCallback,
finishedCallback
finishedCallback,
failedCallback
};
executorProcess.send({