Error Responses
Product Catalogue
The CMP component that details the products and services available to subscribers. web services employ a common error response structure that is consistent across different services. This error response is not coupled with any of the the services therefore exists independently of the request or response structures described in the sections above.
|
Field Name |
Content Type |
Description |
Required? |
|---|---|---|---|
|
ErrorDetails |
Container |
Holds one or more errors related to the request. Individual errors can be either a validation, system or security error or even a combination of above error types. See the Error Response Container for further details. |
Optional |
Error Response Container
The Error Response Container has the following elements:
|
Field Name |
Content Type |
Description |
Required? |
|---|---|---|---|
|
ErrorCode |
String |
Represents the error code associated with the specific error. Following are the valid error code prefix/range specific to each error category.
VAL10000 – VAL19999 (Basic validations) VAL20000 – VAL 29999 (Business validations)
SYS10000 – SYS99999 i.e: unexpected system errors
SEC10000 – SEC99999 i.e: security errors such as login errors, invalid username/password, expired password. |
Mandatory |
|
ErrorMessage |
String |
Description of the error code. Note: This message is intended for the developers. It is a responsibility of the client implementation to provide a understandable descriptive error message for the end users. |
Mandatory
|
|
ExtraDetails |
String |
This will provide more details of the error when applicable. In case of field validation errors this will serve as the field identifier which the error is associated with. Note: For system and security errors this may not be provided. |
Optional |
|
Parameters |
Container |
Provides one or more of parameter values which may help the service consumer to identify the root cause of the error. See the Parameters Response Container for further details. |
Optional
|
Parameter Response Container
The Parameter Response Container has the following element:
|
Field Name |
Content Type |
Description |
Required? |
|---|---|---|---|
|
Parameter |
String |
Value of the parameter which was passed in to the service when the error was triggered. |
Mandatory |
Error Responses and HTTP Status Codes
In addition to the application level error responses, adhering to the REST
Representational State Transfer. An architectural style that specifies constraints, such as the uniform interface, that if applied to a web service results in performance, scalability, and modifiability, optimising services to work on the Internet. best practices, Product Catalogue web services will utilise HTTP Status codes to further help with the error reporting.
Following table depicts the mapping between various HTTP status codes that will be returned along with the different responses.
|
HTTP Status Code |
Description |
Web Service Error Category Mapping |
|---|---|---|
|
200 |
OK |
No error code. Request successful. |
|
400 |
Bad Request |
Any validation errors related to errors in the ranges of VAL10000 – VAL19999 or VAL20000 – VAL 29999 |
|
401 |
Unauthorized |
Any security errors within SEC10000 – SEC99999 error codes |
|
500 |
Internal Server Error |
Any system error within SYS10000 – SYS99999 error codes |
Sample Error Response
The following sample indicates an error response caused by request field validation errors: