Skip to content

chore: Use clearer error message for match validation atomic errors #1721

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

Merged
merged 1 commit into from
Jan 18, 2025
Merged

chore: Use clearer error message for match validation atomic errors #1721

merged 1 commit into from
Jan 18, 2025

Conversation

sevenseacat
Copy link
Contributor

@sevenseacat sevenseacat commented Jan 18, 2025

Getting an error message like this in a test:

** (Ash.Error.Framework)
     Framework Error

     * Tunez.Music.Album.update must be performed atomically, but it could not be

     Reason: can't atomically match an attribute that is not changing

     See https://hexdocs.pm/ash/update-actions.html#fully-atomic-updates for more on atomics.

Doesn't make it clear what's going on or why. I didn't even realize it was talking about a match validation, not a pattern match!

I think this makes it a little clearer what's going on.

Contributor checklist

  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

The previous error doesn't make it clear that its actually a validation issue, and which attribute is raising the error
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

@zachdaniel zachdaniel merged commit cee6d80 into ash-project:main Jan 18, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants