To handle errors and display them to the user in an understandable language, you can make use of the error code responded by Aicado AI at below.

Error Codes

Error responses contain more detail about the error in the response body, in the "code" and "message"properties.

HTTP Status Quote code message
400 invalid_json The request body could not be decoded as JSON
invalid_request_url This request URL is not valid.
invalid_request This request is not supported.
401 unauthorized The bearer token is not valid.
404 Not found The request URL is not found.
405 Wrong method The request method is wrong.
500+ Internal bug. Please file a bug report at s[email protected]

Example

After the action that initiates the “Auto Remove Anything”, a create action will run to save of the prediction’s data. Let’s add a condition to this “create” action. This way, the “create” action in the second step will only run if the action in the first step does not return an error.

Untitled

Now let's add a new action. This action will operate under the condition that the initiate in the first step returns an error, and it will display an error message notifying the user of the situation.

Untitled

Let’s preview and try it!

Untitled

We get an “401” error message, because the bearer token is not valid.

→ Plugin Installation

→ Authentication

→ Start Using Models

→ Examples

→ Error Handling