Skip to main content
When an error is thrown from policies, Apinizer sends the default error message to the user if no customization has been made. Customization of error message/messages is done based on both platform-wide application and application in the relevant policy. All error messages on an application basis can be managed through this page.
For a complete guide on all layers, working principles, priority order and scenario examples of the error message configuration system, see the Error Message Configuration Guide page.

Error Message Priority Order

When an error occurs, the Gateway determines which error response to return according to the following priority order:
If a higher-priority source is defined, lower-priority ones are not evaluated. For example, if a per-error custom message template is active for an error row, the policy-level template or per-error field customizations are not considered.
In policies and the Business Rule STOP action, you can use template-based (dynamic) error messages to write a free-text template and automatically include request/error details with placeholders such as #{error.defaultErrorCode}, #{request.uri}, #{message.correlationId}. For details, see What is Policy? — Error Message Customization.

Customizable Fields

HTTP Status Code, Error Code and Error Message fields in the error message can be customized. Customization can be made by clicking on the relevant field’s cell on the screen.

Configuration Fields

Per-Error Custom Message Template

The Customize button on each error row in the table allows defining a custom message template specific to that error type. This operates at Priority level 1 (highest priority) in the priority order. When the Customize button is clicked, the dialog that opens contains:
When a per-error custom message template is activated, platform-wide customizations for the same error type (customized fields on this page) are not evaluated. The template has the highest priority.
This page manages platform-wide error message customization (Priority level 5). Higher-priority methods such as per-error custom message template and field customization within policies are configured in the policy update screen. For details, see What is Policy? — Error Message Customization.

Error Response Rules

You can define multiple response rules for each error row to return different error responses based on request attributes. Rules are condition-based and match against criteria such as request path, header values, HTTP method, and more.

How Rules Work

  1. When an error occurs, the defined rules are evaluated in order (by sequence number)
  2. The template of the first matching rule is applied
  3. If no rule matches, the next priority level is evaluated
  4. A rule without a condition acts as a catch-all (default rule)
When Custom Message Builder is active: If the Custom Message Builder is enabled for the same error row, Error Response Rules are not evaluated. The Custom Message Builder has the highest priority.

Rule List

When the Customize button is clicked, the Error Response Rules table appears at the top of the dialog: Rules can be reordered using the up/down arrow buttons. Each rule can be edited or deleted. Lisans Bilgileri

Rule Editing

When adding a new rule or editing an existing one, the dialog contains: Lisans Bilgileri

Available Template Variables

The following placeholders and variables can be used in the message template:
Environment variables can be used in ${VARIABLE_NAME} format. For detailed information about environment variables, see Environment Variables.

Policy and Routing Level Rules

Error Response Rules can be defined not only from this page (platform-wide) but also from the error message section within policy and routing configuration.
Error Response Rules defined at the policy or routing level override platform-wide rules. This allows defining custom error response behavior for a specific policy or routing configuration.

Error Type, Error Code and Error Messages Table

Important Notes

API Proxy Responses: Error Parent Type and Error Type fields are not included in messages returned in API Proxy responses. Log Messages: These two fields (Error Parent Type and Error Type) are included in JSON messages where message traffic is recorded. For more detailed information, you can visit the [Sample Message Data Structure] page in the [Log Settings] menu.

Parent Error Type Values Table

Result Type Values Table