1. Home
  2. ...
  3. Flows
  4. Raise Exception

Raise Exception

Editing the response sent to the client in case of interceptor-related or internal errors.

The Raise Exception button enables the API administrator to edit their response to the client in case of interceptor-related or internal errors.

If an error occurs, the object $call.flowError will be populated with the following attributes:

  • message: value which will be displayed in the response body;
  • httpErrorCode: error code that will be returned in the request;
  • position: position of the interceptor in which the error occurred;
  • interceptorType: type of interceptor that failed.

How to use it

The button is in the Flows sector, inside the area where the interceptors are displayed, between the figures reading Request To Backend and Response to Client:

Clicking the Raise Exception button will open the editor, as below:

In the editor, it's possible to create scripts to be executed when there is an exception.

When the flow contains such a script, a different button will be displayed, meaning that the script can be edited:

To remove a Raise Exception script, simply click the red X next to the button.

Types of interceptors and error codes

Type
Message
Request Error
Response Error
AccessTokenValidationThis Access Token is expired403-
AccessTokenValidationAccess Token is in invalid state (PENDING, REVOKED, CANCELLED, REJECTED)403-
AccessTokenValidationCould not find a required Access Token in the request, identified by (location) (name)401-
JsonThreatProtectionJson format invalid400500
JsonThreatProtectionContainer depth limit exceeds the maximum allowed for this API (10)400500
JsonThreatProtectionObject entry count limit exceeds the maximum allowed for this API (10)400500
JsonThreatProtectionObject entry name length limit exceeds the maximum allowed for this API (10)400500
JsonThreatProtectionArray element count limit exceeds the maximum allowed for this API (30)400500
JsonThreatProtectionString value length limit exceeds the maximum allowed for this API (30)400500
JsonThreatProtectionJSON threat protection validation failed: Invalid Content-Type in Header -> (Content type)415415
JsonThreatProtectionJSON threat protection validation failed: Content-Type not found in Header415415
XMLThreatProtectionXML format invalid400500
XMLThreatProtectionName limits element exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionName limits attribute exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionName limits namespace prefix exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionName limits processing instruction target exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionStructure limits node depth element exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionStructure limits attribute count per element exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionStructure limits namespace count per element exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionStructure limits child count exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionValue limits text exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionValue limits attribute exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionValue limits namespace URI exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionValue limits comment exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionValue limits processing instruction data exceeds the maximum allowed for this API (n)400500
XMLThreatProtectionXML threat protection validation failed: Invalid Content-Type in Header -> (Content type)415415
XMLThreatProtectionXML threat protection validation failed: Content-Type not found in Header415415
SqlThreatProtectionSQL Injection attack identified in this API Body400500
SqlThreatProtectionSQL Injection attack identified in this API Headers400500
SqlThreatProtectionSQL Injection attack identified in this API Query Params400500
TimeTokenValidationCould not find a required Time token in the request, identified by (location) (name)403-
TimeTokenValidationInvalid time token in the request, identified by %s %s403-
TokenInterceptorError generating token-500
TimeAllowedTime restriction for this API. Works only (hoursOfDay)429-
SpikeArrestCurrent Spike Arrest Rate exceeds the maximum Rate of %s call each %s %s for this API429-
RestrictAccessAccess denied for this environment.403-
RateLimitCurrent rate (%s) exceeds the maximum rate (%s) for this API429-
PayloadSizeRequest size (%s bytes) exceeds the maximum allowed size for this API (%s bytes)413-
JWT ValidationJWT %s has an invalid signature403-
JWT ValidationJWT is in invalid state %s, rejecting call403-
IP FilteringIP List cannot be null500-
IP FilteringBlocked access from your IP403-
EncryptAn error occurred during the encryption mode422-
EncryptAn error occurred during the encryption mode422-
DateTimeThe request is out of the accepted date range between: %s and %s423-
Custom InterceptorError during process custom interceptor '%s': %s500-
ClientID ValidationCould not find a required APP in the request, identified by %s %s401-
ClientID ValidationAPP is in invalid state %s403-
CSRF ValidationCould not find a required CSRF Token in the request, identified by %s, %s401-
CSRF ValidationCSRFToken is expired403-
CSRF ValidationRequests with different origins403-

Example

Check Authorisation Error 401:

For information on writing a custom JavaScript interceptor, click here.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more