Hi All,
I came across a scenario where a proxy is developed using mostly node js.
So, while running the same using postman the result is sporadic.
For eg. out of 10 runs I get 3-4 times "500 Internal Sever Error",
{ "fault": { "faultstring": "Script node executed prematurely:..............
.................................
.....................,
"detail": { "errorcode": "scripts.node.runtime.ScriptExitedError" }
}
}
Solved! Go to Solution.
ScriptExitedError
means your script exited.
This often happens if you have a runtime exception in your code, which is not caught.
Uncaught exceptions will lead to the script exiting.
To address this, track down and handle the uncaught exception.
Eg, you may wish to add something like this to your nodejs module to document WHERE the code is getting an exception.
process.on('exit', function (code) { console.log('Script terminating with code %s', code); }); process.on('uncaughtException', function (err) { console.log(err.stack); });
That won't solve the problem, but it will help you identify the source of the problem.
BTW, To actually SEE the output of these handlers, you need to look into the nodejs logs. Use the Apigee Admin UI to view those.