If I have a javascript code step in a Zap, can I throw an exception to get the Zap to halt? I found there was a HaltException and/or HaltError in the CLI, but wasn’t sure if it was available in the WebUI code steps.
Here’s my scenario - I have a javascript code block that maps inputs to a location ID. Works great, when the location is found. When the location isn’t found, I can return -1 or something that causes an error in one of the later steps… but I know at the current step that I have a problem - and I’d like to just stop the Zap at that point so I can investigate or fix the location ID mapping.
Oh - I guess I could get the Zap to stop processing by doing something silly like this:
if( locationID == null ) {
someObviousSyntaxException();
}
It will cause the execution to fail because the method isn’t found, but I hope there is a better way to stop the Zap from continuing.