Update Function catch tests to handle async receive

This commit is contained in:
Nick O'Leary
2019-08-21 11:39:34 +01:00
parent b734097d16
commit a17325f028
2 changed files with 55 additions and 49 deletions

View File

@@ -282,13 +282,13 @@ module.exports = function(RED) {
if (!errorMessage) {
errorMessage = err.toString();
}
this.error(errorMessage, msg);
done(errorMessage);
}
else if (typeof err === "string") {
this.error(err, msg);
done(err);
}
else {
this.error(JSON.stringify(err), msg);
done(JSON.stringify(err));
}
}
});