Trapping Script node executed prematurely

Is there a way to trap the Script node executed prematurely error? I want to trap it and change the presentation into a standard error format used in the API. Neither the fault rules in the ProxyEndpoint, nor those in the TargetEndpoint seem to be executed.

For info, in this instance I know what is causing the error and am able to fix it, I just wanted to be able to trap any future unforeseen occurences of the error.

0 2 216
2 REPLIES 2

Hi Dave, can you give me a specific example of the kind of problem you want to catch?

Maybe a test API proxy with a broken script that Always throws?

Show us the scenario.

Hi Dino, the specific issue was caused by a missing node module. It seems to throw the error almost before it's actually got to the Node-js code itself.