Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand uncaught ValidationException messages #11423

Open
2 tasks
emteknetnz opened this issue Oct 10, 2024 · 0 comments
Open
2 tasks

Expand uncaught ValidationException messages #11423

emteknetnz opened this issue Oct 10, 2024 · 0 comments
Assignees

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Oct 10, 2024

DBField ValidationException started being thrown in #11403

The "message" is usually something simple such as "Must be numeric", which is fine in context of context of validation within forms as their is also a "fieldName" key that can be used to link the message to a UX form field.

However in the case of dev/build or other programmatic tasks, the validation message lacks "fieldName" and "value", which makes debugging harder then it needs to be

Notes

  • Value was at one point added to ValidationException the DBField PR - though ultimately taken out. If we proceed with this work it should be added back it

Acceptance criteria

  • ValidationException are caught and the "message" is expanded to include the "fieldName" and "value" in dev/build like contexts
  • They are not expanded when run in a form submission context e.g. form submission, HTTP request via API
@emteknetnz emteknetnz transferred this issue from silverstripe/.github Oct 10, 2024
@emteknetnz emteknetnz changed the title Expand uncaught validation messages Expand uncaught ValidationException messages Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant