linebender / linebender/druid

"improve" error handling in druid-shell

Open
#311 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement shell
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.