"improve" error handling in druid-shell
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.7k
- Forks
- 565
- PR merge metrics
- No merged PRs in 30d
Description
Error handling in druid shell is currently bad. We would like it to be good! This is a solvable problem!
Background
druid-shell started out as a windows-specific proof of concept. The existing error handling is left-over from that period. As druid-shell was adapted to be multi-backend, error handling was ignored, and now it's basically useless.
how it should work
Each platform should expose a platform-specific error type that mimics as closely as possible the system error type on that platform; so on macOS it should look like NSError, on windows it should be the system error code from GetLastError and the message returned by FormatMessage.
druid-shell's error module should have an Error enum that includes a Platform(_) variant for the platform specific error, and then normal variants for other conditions related to invalid inputs, io failure, etcetera.
We should return meaningful errors whenever possible.
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 with druid-shell's error module and map how platform errors are currently represented. Review the platform-specific behavior described for macOS NSError and Windows GetLastError/FormatMessage. Done means each platform exposes a meaningful error type and the error module includes Platform(_) plus variants for other conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100