-
Notifications
You must be signed in to change notification settings - Fork 285
Add Error Codes to Errors #545
Comments
Ideally, the errorCode would be unique app-wide. |
I think that's a hard requirement. |
This would be a major under taking as there are literally an unknown number of errors that can be returned because it will pass the error message from lower level libs. It would need to convert every error from a lib into a more generic message which might be less useful for debugging. |
That's understood. We still need to do it. If we can think of a more efficient way to do it, that would be useful.
I think that's a misunderstanding. The original error message would be maintained, we'd just add an error code to the json returned, in addition to the original error message, as outlined in the issue. |
To make server errors easier for the users to understand, and to make it possible to provide translations for them, add an error code field to each error.
The proposed format is:
This would allow clients and scripts without a mapping of the codes to use the reason text, while clients with translations could use the code to show a translated text.
EDIT: as Rob reminded me, the errorCodes should be unique, and the same number should never be used for more than one error code, as it will be mapped directly to a translation string.
The text was updated successfully, but these errors were encountered: