I'm Guide - Custom Error Exception
Overview
Current Version
Document Version: 1.0
Release Date: Nov 30, 2024
Basic Response Error Format
Response Field Description
Field | Type | Description |
---|---|---|
statusCode | integer | An HTTP error code indicating the specific error type. |
error | string | A brief HTTP error code title describing the error. |
message | string | A detailed description of the specific error. |
I'm Guide Custom Response Error Format
Custom Response Field Description
Error Code | HTTP Error | Message | Description |
---|---|---|---|
400100 | 400 | Invalid Data | The input data does not match the required pattern or format. |
400200 | 400 | Not Enough | Insufficient data provided to complete the requested task. |
Only Some Endpoints Have Custom Status Codes. Check the endpoints referenced in the next part of this document.
Custom Response Field Description
Field | Type | Description |
---|---|---|
status | string | A unique custom error code to identify the error. |
message | string | A brief, human-readable description of the error in English. |
data | object | Contains additional details about the error, such as Thai translations or context-specific fields. |
th_message | string | (Optional) A user-friendly error message in Thai, providing a localized explanation. |
Other fields | any | Any other relevant data about the error (e.g., counts, input parameters). |
Endpoints Using Custom Error Codes
HTTP Method | Endpoint | Custom Error Codes |
---|---|---|
POST | /trips/v1/custom/preset | 400100 , 400200 |
Ensure you handle custom error codes only for these endpoints
Best Practices for Using Error Codes
1.
2.
3.
4.