Forum Academy Marketplace Showcase Pricing Features

How to show API error message to User

Whenever I get an error from API, I receive the error message that shows

Raw error:
{"status":"invalid","reasons":[{"code":"project-locked","description":"Project Busy: Finance Agreement is being generated"}]}

How can I show this message to our users UI without showing the message with "[{"code":"" and only show the actual texts like

{"status":"invalid","reasons":[{"code":"project-locked","description":"Project Busy: Finance Agreement is being generated"}]}

When I do show error message, it contains the "[{"code":"" texts.


Hi @dojin23

Maybe this one can help and handle the unknown or known errors . Haven’t tried on API though, so sorry in advance if it does not work.

Hope it helps :slight_smile:

do what @contantestar has already suggested along with displaying an Alert

1 Like

I did and still showing the messages in messy manner.

How could I display the error messages to the user without the quotes and symbols?

Display your own message. SOmething like “An error has occured. Please contact support @ [email protected]

What if I want to display and pass the error message response from the API?

Extract with regex Unauthorized - which is the error coming up.

This is definitely not the most efficient way

LOL ok. I hope you find the most efficient way.

1 Like

Hmm I think if you are able to assign an Option set or condition to the Error Code you receive you should be able to make a custom text for it. For example if current workflow error’s message contains HTTP 401 display X

Would need to get a list of all the errors but it could work if there are no duplicate error codes.