Force error condition

Hi,

I want to terminate the current cycle with an error under certain conditions. I saw someone else doing it by making an HTTP request to a bad URL. The end result is exactly what I need, but is there no dedicated way of doing it?

1 Like

That’s a great idea!

As far as I know, that workaround is currently the only way to force terminate a running scenario, with an error. To do that you have to trigger the error somehow.

You can submit this suggestion to the Idea exchange, under App improvement ideas. Don’t forget to search for it first, just in case someone already suggested it!

2 Likes

This article describes another workaround using a JSON module.

5 Likes

Oh, that’s much better! I was using a router with filters, but using this I can do it all inline. Thanks!

1 Like

I found myself needing to do an inverse check, too. It was not as straightforward, but this works:

if([67.ID]; {}; [null])

Is there some keyword I can use instead of {} that yields valid JSON? Just looks nicer… [emptyarray] did not work.

Edit: Also, can I rethrow with a more useful error message, or is that limited to module implementation? I suppose I might be able to make an error handling app…

{} is the bare minimum valid JSON… Would you rather do this instead?:

{"valid":true}

You can customise the error message from a scenario using a Webhook Trigger, by using a Webhook Response module.

2 Likes