Deliberately throw an error on certain condition

:bullseye: What is your goal?

I want to deliberately throw an error under a certain condition to get notified once that happens.

:thinking: What is the problem & what have you tried?

I can not find a way to do so. Tried this, but could not follow through: Throw - Help Center

You can try doing this. I made the guide based on Error Handling | Throw, but this is much simpler. You can add a router after the module you want to check, or throw an error.

Create these routes:

Route 1: Create a filter like status is equal to 200, then connect it with the rest of your modules.

Route: 2: Create a filter like status is not equal to 200 or any error code you want. Add an Email or Slack module to send you a notification. Add a Break module right after it.

This is the simplest way of doing what you’re trying to achieve. I hope this helps you!

Hello,

Crucial question - does your module return an error or is it marked as success but based on output you want to mark the scenario as an error?

For option 1 (module returns error) follow this guide:

Option 2 - If your module is marked as success
Add a router after it and configure route 1 for success and route 2 as error.

Example:

Since you cannot use error handlers as standard modules, you won’t be able to add them for the router.
However, to stop the scenario from processing, you can create an error yourself.

For example, using an HTTP module with an invalid URL :slight_smile:

Hope thats what you had in mind.
Michal