Handling Errors
The 401GO API uses a specific error format that is predictable between different types of errors. The structure for a single error message is show below:
{
"user_error_message": "This is an error message that can be shown to users.",
"developer_error_detail": "A nullable message providing extra context that may contain variable_names or descriptive information that only a developer should read."
}
Some examples of different error responses:
- A single error not relating to a specific field of submitted information
{
"developer_error_detail": "The requested item does not match the expected type for this endpoint.",
"user_error_message": "Invalid operation, please reach out to support."
}
- Errors with information submitted in a POST request, including nested JSON data
{
"loan_duration": {
"developer_error_detail": "cannot be more than 5 years if is_primary_residence is False",
"user_error_message": "Cannot be for more than 5 years"
},
"address": {
"city": {
"developer_error_detail": null,
"user_error_message": "This field is required."
},
"postal_code": {
"developer_error_detail": null,
"user_error_message": "Ensure this field has no more than 20 characters."
}
}
}
- Errors with both information submitted in a POST request, as well as one not directly caused by field data
{
"name": {
"developer_error_detail": null,
"user_error_message": "This field is required."
},
"non_field_error": {
"developer_error_detail": "This is a specific message for an error not directly relating to a submitted field.,
"user_error_message": "There was an error retrieving your account information."
}
}
Updated about 1 month ago