rust-lang / rust-lang/rustc-perf
Error message is confusing when piece of query has no data for it or is misspelled
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 733
- Forks
- 189
- Avg merge
- 10h 52m
- Merged PRs (30d)
- 43
Description
I ran into an issue where I was querying for "instructions:u" on local data where the instructions data had not been collected (presumably due to missing support in WSL). The error message returned from the API was confusing and didn't help me quickly realize what was happening.
The current error comes directly from the intern crate. It was "ProcessStatistic does not have instructions:u as a valid value". This happens when we try to parse the string "instructions:u" as a ProcessStatistic and there is not interned string.
intern seems to be a fairly independent crate so changing the error message there seems to not be the right move. Instead we can change the error when parsing ProcessStatistic and the other query pieces (using map_err) to something like: "'instructions:u' is not a valid statistic. Ensure that 'instructions:u' is spelled correctly and data related to it has been stored in the database.".
Contributor guide
No contributing guide indexed for this repository
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 at the parsing of ProcessStatistic and the other query pieces, where the issue suggests using map_err instead of changing the intern crate. Trace how the API surfaces these parse failures, then make invalid or unavailable statistics produce a message that identifies the statistic, suggests checking its spelling, and explains that its data must be stored in the database.
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