How should I return an error from a JS cloud function so that the error message is usefully available?

I’m aiming to return a useful error message from a cloud function.

Operations:

  • user completed 0auth, is redirected to make webhook
  • make.com exchanges the received code for a token
  • make.com sends user data to our system
  • make.com webhook responses redirect the user or return an error

From our system, which is called using an http module, how can I return errors to make so that they shows up in one of the available error handling data items.

What would need to be returned so that instead of showing a generic 400 error, I can for example, return (for example): “Error Logging in, please restart”

Currently I return this as body and it shows on a relatively empty webpage, which is fine for now.

Hello! Welcome to the Make Community!

When you make the HTTP call from Make, you can keep the default behavior, which consists of not throwing an error when the called endpoint returns 400, 500, etc… and in that case you can have a router after the HTTP module, and filter the HTTP code returned.
If it’s a 400, you can get the payload of the response from your server and pass the information using the Webhook response.

If you configure the HTTP module to capture errors, you can still use a error handler (with an Ignore module), and add a webhook response before the Ignore. But I’m not 100% sure you can get any payload from the HTTP call in that case; it has to be tested.

I hope it answers your question.

Cheers,

Benjamin

2 Likes

Response appreciated.

My question is if it’s possible, when using error handlers, to capture the error response payload.

Because right now, I end up taking most of what I build to postman which gives me real error feedback making it much easier to build. Then I have to spend more time fitting that to make. Which is often the much harder step, despite being a “low code”.

Frankly it’s silly that after nearly a decade of using make, this is still unclear.
(I hope that the silliness is on me for not having learned it, rather than it doesn’t exist.)

I end up doing a lot of extra work as a result of not making basic error messages available, which is kind of like developing 101.

So I’m holding out hope that someone, somewhere, understands the importance of error messages, and built that in already, and I just don’t know how to use it yet.

Otherwise, it’s mind blowing that this wouldn’t be the top of every product backlog and feature request list.

Because “How can I get debugging information” is the first question any dev is going to ask.

To build a product that doesn’t provide this, or to rely on a very janky dev plugin that runs slow as molasses, hasn’t been updated in years, and needs several reloads before it works, shouldn’t be enough for anyone building anything serious.