How to Retry HTTP Requests on Non-200 Status Codes

I am using the HTTP module to make a request to an API and retrieve data. However, sometimes the API response contains a status code other than 200, such as 500. In these cases, instead of data, I receive an error message, and I need to rerun the HTTP module.

I usually use the Break module, but this situation is a bit different because the HTTP module does not display an error, and the scenario continues to run. How can I rerun the HTTP module if the status code is not 200?

The option to throw an error is hidden in the HTTP module’s β€œShow advanced settings”.

Toggle it on and scroll all the way up to find the field and options.

Then, handle the error with a Break, or a cloned module + Resume.

samliew – request private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

Thank you for your help, but I couldn’t find this option in the HTTP module. I’m attaching a screenshot of the advanced settings.


I found it. It’s the first item in this module.

2 Likes

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

4. Do join the unofficial Make Discord server for live chat and video assistance

samliew – request private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes