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

cast changeset errors even if they have other metadata attached #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmiller42
Copy link

@mmiller42 mmiller42 commented Aug 25, 2024

I've noticed this for a while but it's not a big problem... but I think the reason why a lot of our changeset error codes get translated to "unknown_error" is because the keyword list in the changeset can include other properties. It would be nice to probably also send those to the frontend really -- for example, if the error is "Name is limited to 100 characters", returning the max characters in the payload is helpful for localization e.g. "code": "max_length", "message": "Name is limited to 100 characters", "validation": { "max_length": 100 }

note: untested, just wrote in GitHub editor directly as a proposal 😬

I've noticed this for a while but it's not a big problem... but I think the reason why a lot of our changeset error codes get translated to `"unknown_error"` is because the keyword list in the changeset can include other properties. It would be nice to probably also send those to the frontend really -- for example, if the error is "Name is limited to 100 characters", returning the max characters in the payload is helpful for localization e.g. `"code": "max_length", "message": "Name is limited to 100 characters", "validation": { "max_length": 100 }`

note: untested, just wrote in GitHub as a proposal

Signed-off-by: Matt Miller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant