I want to mark a Logic App workflow as failed by throwing custom exceptions using standard JavaScript, and I want to properly redirect the exception message to the Azure portal output. How do I accomplish this?
Here's some test code to show what I mean:
function testError() {
throw 'this is an error error';
}
testError();
return 'nothing';
When executing this step, I get InlineCodeScriptRuntimeFailure. The inline code action 'JavaScriptCode' execution failed, with error '<null>'.
That '<null>'
error is really unhelpful, and I'm surprised it doesn't work out of the box. When running the exact same code in a Node.js environment, I get Uncaught Error this is an error error
, which is more in line with what I want to display in the portal.
What am I missing here?