Browse Source
Merge pull request #6809 from vvlladd28/bug/js-executor/incorrect-error
[3.4] JS-executor: Fixed incorrect parse error code for message
pull/6840/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
1 deletions
-
msa/js-executor/api/jsInvokeMessageProcessor.js
|
|
|
@ -144,7 +144,7 @@ JsInvokeMessageProcessor.prototype.processInvokeRequest = function (requestId, r |
|
|
|
}, |
|
|
|
(err) => { |
|
|
|
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; |
|
|
|
} else { |
|
|
|
errorCode = RUNTIME_ERROR; |
|
|
|
@ -321,4 +321,8 @@ function deleteMinUsedScript() { |
|
|
|
this.scriptMap.delete(prevScriptId); |
|
|
|
} |
|
|
|
|
|
|
|
function isString(value) { |
|
|
|
return typeof value === 'string'; |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = JsInvokeMessageProcessor; |
|
|
|
|