Errors are a fundamental component of Wix's APIs, providing critical information and guidance when something goes wrong. Most of Wix's errors follow a standardized format, as described below.
Property | Description |
---|---|
message | Textual description that provides a brief explanation of the error. |
details | Additional contextual information about the error, including either applicationError or validationError . See the tables below. |
An application error occurs when the service business-logic decides to reject the request. This includes codes like UNAUTHENTICATED
, PERMISSION_DENIED
, NOT_FOUND
, ALREADY_EXISTS
, ABORTED
and RESOURCE_EXHAUSTED
.
Property | Description |
---|---|
code | Identifier that categorizes and signifies the specific error. |
description | Detailed explanation of why the error occurred. |
data | Additional contextual information related to the error. |
A validation error occurs when input data fails to meet predefined criteria or constraints set by the system. This type of error serves to enforce rules such as correct data formats, required fields, or value ranges. This includes rules like OUT_OF_RANGE
and INVALID_ARGUMENT
. Multiple violations may be returned in one response.
Property | Description |
---|---|
fieldViolations | Array of validation issues found in individual fields. |
fieldViolations.field | Field name. |
fieldViolations.description | Detailed explanation of why the error occurred for the specified field. |
fieldViolations.violatedRule | Specific rule or constraint that was violated by the input in the identified field. |
fieldViolations.ruleName | Name of specific rule or constraint that was violated. For example, "VALIDATION_ERROR" . |
fieldViolations.data | Additional contextual information related to the field violation. |
A system error occurs when there's an exception in the system, server is down, or some dependent service or database is down.
These errors are sent empty by design.