oxidecomputer / oxidecomputer/omicron
Improve error message for invalid name in path
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
From https://github.com/oxidecomputer/omicron/pull/2582#discussion_r1139212851
Because the v1 endpoints take names or IDs, we no longer give a nice message when someone tries to give an invalid name. Instead of "that's not a name because..."
"bad parameter in URL path: name must begin with an ASCII lowercase character"
We now say "beep boop Rust computer robot failure":
"bad parameter in URL path: data did not match any variant of untagged enum NameOrId"
The message does suggest to the 🧐 connoisseur that the problem is that the thing is not a name or ID, but way too much of the implementation is leaking out in the message.
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
Read the v1 endpoint path-parameter handling and the NameOrId deserialization referenced by the issue, using the PR #2582 discussion for context. Done means invalid names produce a user-facing validation message rather than exposing the untagged-enum implementation detail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100