luckyframework / luckyframework/avram
Save error doesn't give user a clue
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 183
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/luckyframework/avram/blob/02496a12c817e2fdfcf6d55834e1380afabe6e2d/src/avram/save_operation.cr#L324
This renders as:
```
Unhandled exception: Could not perform RegisterUser.
▸ save_user_options: failed
(Avram::InvalidOperationError)
from lib/avram/src/avram/save_operation.cr:322:7 in 'save!'
from lib/shield/src/presets/user.cr:23:1 in 'create!'
from tasks/db/seed/required_data.cr:35:5 in 'call'
```
The problem was a missing field after a migration. So, Postgres probably had something to say. But no clue was passed to the user.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/avram/save_operation.cr around line 324 and inspect how the save! failure becomes InvalidOperationError. Reproduce the missing-field-after-migration case, then verify that the underlying Postgres clue is preserved in the user-facing error output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal, postgres
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100