HTTP, Error Handling and Router issue

Hi Community,

I’ve faced a strange issue with my scenario in Make and try to understand how to resolve it.

I have a scenario with a router which has 3 paths. I expect them to execute sequentially (as router works). On 2 of these paths there are HTTP requests.
I would like the scenario to be stopped in case any of HTTP requests have failed, and I’d like to store the execution to be able to resolve it manually.

What I have noticed is that when I use “Break” directive, the subsequent modules on this path do not execute, but other Router paths do execute:


Questions:

  • Is it an expected behaviour or I’m doing something incorrectly?
  • How do I stop scenario from execution of other Router paths, and store the incomplete execution?

Did quite a bit of search here and in FB, but didn’t manage to find an answer.

Thanks a lot for help!

Victor.

Hey @VictorK , good question!

  1. Is it an expected behaviour or I’m doing something incorrectly?

Yes this is expected behavior. The break only stops the subsequent modules within the same path. A router is build this way so that no matter if something stops in the other path, the others continue with their execution.

  1. How do I stop scenario from execution of other Router paths, and store the incomplete execution?

There are 2 ways

  1. either you all run them in serial without a router (you don’t want this right now)
  2. Or you set an error variable and don’t continue if something goes wrong

What i mean by setting an error variable is the following:

  • You add a router in your error route
  • Next to the break, you add a set variable where “error” is true
  • If something goes wrong, the error is true
  • In the last path you use a “get variables” and check the error variable
  • If there is an error, you do not continue

The only issue with this, is that the state of everything gets saved with the “break” handler. If you re-retry this certain scenario run again, the error will still be true and the last route will still not continue.
No sure if this would be an issue for you since I do not know your case.





t

3 Likes

Hey @Bjorn.drivn,

Thanks a lot for your reply. Good to know that it’s expected!

Also thanks for the advice about the error variable. I’ll explore this path.

By the way, do you know if using Rollback instead of Break helps? Any potential issues using it in this case?

Thank you.

Best,
Victor.

1 Like

Answering my own question: tested the scenario with “Rollback” directive - it stops immediately but no incomplete execution is saved.

Seems that manual error handling is the only option here.

2 Likes