Initiate error handling on API status code 204

I’m working with a API that for some odd reasons throws a 204 when it gets some internal network error. Is there any way to map 204 as an error and trigger break or other error handling?

Hi Nicklas,

Yes, that’s possible. You can right-click the module and select ‘Add error handler’

Once done, you can add ‘Break’ for example. Then, add a filter between your module and the error handler and only use the error handler if the Error message contains 204:

Is this the solution you’re looking for?

I’ve tried that actually, it seemed like the most logical way to do it. But it seems like the error handling route cannot be initiated on a 2xx status code? It never reaches the filter even of the filter says 204, it doesnt initiate the route at all.

Can you provide me the setup of your HTTP module by any chance?

Because your problem might be in the top-line of the module:

This is my configuration, is it the ”except for 2xx and 3xx) that excludes my 204 as being treated as an error?

Hi @Nicklas

That looks like an edge case for Make.

The statuses that are treated as errors are anything other then 2xx and 3xx if you set that option to “Yes”. This way, 204 will never be treated as an error, will not generate an error message and will not be handled by an error handler. You can’t even get the status code in the filter for the error handler.

If you set it to “No”, you are actually disabling error handling based on status code for that module.

I believe your best shot here would be to set it to “No”, add a router and then have the status code checked in that route. Something like this:

The Ignore handler here is just for demonstration purposes and has no effect, btw.

@damato

Yes Nicklas, that’s true.

Also, I think you know what the error code 204 means, right?

Maybe it can be the case that the HTTP request comes through, but is not handled correctly.

If you can’t find out what the real problem is, @damato’s way might be the way to go here.

Another way would be to create a custom app that throws an error on status code 204…