How to parse the HTTP request error

Hello guys,
I’m a newbie to UI Bakery, could you please help me?

I have a POST HTTP request which registers a new user in the Backendless database. It works fine if user doesn’t exist, but if exists - Backendless server returns an error that the user with similar credentials already exists.

But the error from my http request in UI Bakery looks like this:

Http failure response for https://api.backendless.com/APP_ID/API_KEY/users/register: 409 Conflict

Is there any way to parse the error from Backendless properly? I don’t want to show my users the message I’ve attached, but the one from Backendless which is more informative.

Many thanks,

Regards,
Olha

Hello @olhadanylova!
In the next step after HTTP, you can use this variable: {{error}}
It will remain empty if everything’s fine, and it will contain a server error if it appears.
Does it help? :slight_smile:

Thank you for the response :slightly_smiling_face:
I’m trying to print the error message in the text field like this:

{{error}}.message

And it prints out this message:

Http failure response for https://api.backendless.com/APP_ID/API_KEY/users/register: 409 Conflict

Just want to clarify whether I can get more informative error message because Backendless server returns other error description and UI Bakery shows me this one.

Regards,
Olha

@olhadanylova
You can make console.log({{error}}) and check its structure. It’s highly possible that to get an error from the backend, you need to write {{error.error}}

Got it!
Thanks alot!

1 Like