Browse Source

JS-executor: Fixed incorrect parse error code for message

pull/6809/head
Vladyslav_Prykhodko 4 years ago
parent
commit
352abb3f60
  1. 6
      msa/js-executor/api/jsInvokeMessageProcessor.js

6
msa/js-executor/api/jsInvokeMessageProcessor.js

@ -144,7 +144,7 @@ JsInvokeMessageProcessor.prototype.processInvokeRequest = function (requestId, r
}, },
(err) => { (err) => {
var errorCode; var errorCode;
if (err.message.includes('Script execution timed out')) { if (err && isString(err.message) && err.message.includes('Script execution timed out')) {
errorCode = TIMEOUT_ERROR; errorCode = TIMEOUT_ERROR;
} else { } else {
errorCode = RUNTIME_ERROR; errorCode = RUNTIME_ERROR;
@ -321,4 +321,8 @@ function deleteMinUsedScript() {
this.scriptMap.delete(prevScriptId); this.scriptMap.delete(prevScriptId);
} }
function isString(value) {
return typeof value === 'string';
}
module.exports = JsInvokeMessageProcessor; module.exports = JsInvokeMessageProcessor;

Loading…
Cancel
Save