Returning Errors
Describes the error response which is used in common by all APIs of the CODE solution.
This chapter describes the error response which is used in common by all APIs of the CODE solution.
All APIs in the code are designed to return an error response which combines Status Code, Error Type, and ErrorMsg described below when an error occurs while processing the request.
Please make an implementation so that even the VASP API of the CODE implemented in the VASP server returns an error according to the classification as below.
Please note that the error returned by the CODE API server and the error returned by the VASP API server may differ depending on the status code. Even for the same ErrorType, the subject that returns an error is different depending on the status code.
'invalid' and 'denied'
Since invalid of the wallet address search request or the denied result value of the asset transfer authorization request is a result of processing the request normally, it is not included in the error.
422 Validation Error
This error is returned by the CODE API server.
This is an error returned by the CODE API server when failing to check the parameter of a message received by the CODE API server. This applies to both a message processed directly by the CODE API server and a message delivered to the VASP API.
- errorType: Error type
- INVALID_TARGET_VASP_ID: The Entity ID of the VASP entered as a parameter is not valid.
- MISSING_REQUIRED_MSG_FIELD: A required message field is missing when processing a request.
- MISSING_HEADER_FIELD: A required header field is missing.
- INVALID_MSG_FIELD_VALUE: The value of the message field is not valid.
- DUPLICATED_HEADER_NONCE: This is a case where the Nonce value of the message header is retransmitted within 1 minute. Please set this to a value that changes each time a request is sent.
- INVALID_HEADER_SIGNATURE: This is a case where the signature verification of the message header has failed.
- INVALID_RECEIVER_PUBLIC_KEY: This is the case where the other public key of the request header is not valid. The public key of the other VASP may have been changed.
- ILLEGAL_FORMAT_OF_ORIGIN: The character string format of the header origin is abnormal. Please send in the {AllianceName}:{VaspEntityId} format.
- INVALID_ORIGIN: The value of header origin is not correct. VaspEntityId cannot be found or AllianceName is not valid.
- errorMsg: This is used to convey detailed information on the ErrorType. This can be omitted.
{
"errorType": "INVALID_TARGET_VASP_ID",
"errorMsg": "VaspEntityId received is."
}
408 Request Timeout
This error is returned by the CODE API server.
This is an error returned by the CODE API server when the CODE API server passes a request to the VASP API server, which processes the request actually, and when the response time is exceeded.
- errorType: Error type
- BENEFICIARY_VASP_REQUEST_TIMEOUT
- errorMsg: This is used to convey detailed information on the ErrorType. This can be omitted.
{
"errorType": "BENEFICIARY_VASP_REQUEST_TIMEOUT",
"errorMsg": "Beneficiary VASP does not respond."
}
429 Too Many Requests
This error is returned by the CODE API server.
Specific APIs that can affect the performance of the entire system limit the number of requests that can be sent per second by source IP. This returns this error if the number of requests exceeds the limit value.
- errorType: Error type
- TOO_MANY_REQUESTS
- errorMsg: This is used to convey detailed information on the ErrorType. This can be omitted.
{
"errorType": "TOO_MANY_REQUESTS",
"errorMsg": "The request has exceeded the limit (40) per minute, source IP."
}
500 Internal Server Error
This error is returned by the CODE API server.
This returns this kind of error when an error occurs while the CODE API processes a request directly.
- errorType: Error type
- RECEIVED_WRONG_JSON_MESSAGE: The JSON message responded by the recipient is not readable.
- RECEIVED_MSG_MISSING_FIELD: There are missing fields in the message responded by the recipient.
- CODE_SERVER_INTERNAL_ERROR: An error occurred while the CODE server processes a request.
- errorMsg: This is used to convey detailed information on the ErrorType. This can be omitted.
{
"errorType": "CODE_SERVER_INTERNAL_ERROR",
"errorMsg": "An internal error occurs while processing."
}
503 Service Unavailable
This error is returned by the VASP API server.
This is an error returned by VASP if an error occurred while the VASP API server processes a request. If the VASP API server returns an error, it passes through the CODE API server to be sent to the VASP that has sent the request.
Status Code and ErrorType classification do not completely match CODE API server.
- errorType: Error type
- UNKNOWN_TRANSFER_ID: The requested TransferId does not exist.
- VASP_BACKEND_INTERNAL_ERROR: An internal error occurred while the VASP backend processes a request.
- MISSING_REQUIRED_MSG_FIELD: A required message field is missing.
- MISSING_HEADER_FIELD: A required header field is missing.
- INVALID_MSG_FIELD_VALUE: The value of the message field is not valid.
- DUPLICATED_TRANSFER_ID: This is a case where received TransferId already exists.
- INVALID_HEADER_SIGNATURE: This is a case where the signature verification of the message header has failed.
- INVALID_ENCRYPTED_BODY: This is a case an encrypted message cannot be decoded.
- UNACCEPTABLE_REQUEST: It is an unprocessable request. The content of the request cannot be processed by the VASP that received it.
- errorMsg: This is used to convey detailed information on the ErrorType. This can be omitted.
{
"errorType": "VASP_BACKEND_INTERNAL_ERROR",
"errorMsg": "An VASP backend server failed to process request."
}
Updated 4 months ago