It is tedious to automate error handling.
My proposition is to create error codes (NOT http codes) that will precisely describe what happened. In addition to the existing error messages.
All codes should be uniquely assigned to specific errors. Once created codes should not change, for backward compatibility. Better add new.
Examples:
e.g, 25 is 'API keys are no longer valid or incorrect'
{
"msg": "Other error occurred: record_invalid Invalid parameters {'api_key': ['API keys are no longer valid or incorrect. If you have just created this key, please wait 30 seconds and try again.']}.",
"internal_error_codes": [ 25 ]
}
It is tedious to automate error handling. My proposition is to create error codes (NOT http codes) that will precisely describe what happened. In addition to the existing error messages. All codes should be uniquely assigned to specific errors. Once created codes should not change, for backward compatibility. Better add new.
Examples:
e.g, 25 is 'API keys are no longer valid or incorrect' { "msg": "Other error occurred: record_invalid Invalid parameters {'api_key': ['API keys are no longer valid or incorrect. If you have just created this key, please wait 30 seconds and try again.']}.", "internal_error_codes": [ 25 ] }
Multiple error occured: { "msg": "....", "internal_error_codes": [ 67, 21, 2 ] }