Consider expanding out the error types for the platform traits
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 144
- Avg merge
- 12h 21m
- Merged PRs (30d)
- 146
Description
We might want to consider would have some way to provide platform-specific error codes. For example, a `PlatformSpecificOther(i32)` variant added to places like https://github.com/MSRSSP/litebox/blob/3dd3c09a721dab0f088fbd30fcc6dbd7cbad0a13/litebox/src/platform/mod.rs#L459-L465
One important factor to consider is how upper levels can/should handle such error codes if they ever occur. By _not_ having platform-specific error codes (except for punchthrough, of course), it is quite straightforward to know how an error should be handled by looking at the error codes. If we have platform-specific errors, then the only possible thing is to bubble them up, at which point, it is unclear if we are actually benefiting from this.
My stance thus far has been that if a platform needs to bubble up an error code, then that should just get added to the specific allowed errors at various points. This might need to be re-visited as we add more platforms. In particular, @ppenna was mentioning at least one scenario where having more error codes would help for the LiteBox-Nanvix platform.
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 litebox/src/platform/mod.rs around lines 459-465 and trace how platform traits currently represent and propagate errors. Review the issue's tradeoff between platform-specific codes and explicitly allowed errors at upper levels. Done would require a decided design for the Nanvix scenario and corresponding implementation scope, which the issue does not yet specify.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100