validateInput hook: addValidationError should accept an error code in addition to the message #7300
remygendron
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Architecturally, the API consumer or client, is responsible for displaying messages in a format aligned with the view:
It is OK to provide a textual message, as this will get displayed in the Admin UI. However, for all the other use cases, an error code is necessary so that the client selects a proper message.
Error codes are also necessary to facilitate I18N of the messages on the client side.
As a work around, I currently prefix my error messages with a code, like:
'listname.fieldname.not.null:The default and admin ui error message.'
Beta Was this translation helpful? Give feedback.
All reactions