Introduce replacement error type. #2492
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces the new error handling type, which has been mercilessly ripped out from the other branch I was working on, but is a lot less of a "rewrite the world" kind of change, and something we can migrate to. For example, this doesn't migrate us to it at all. That's something we'll do as we clean up some of the code.
There are a couple pieces that aren't quite finished, such as backtrace/spantrace handling (for one, do we want/need both of these?), and I suspect the things I'm doing here are... suboptimal on embedded. I'll write down a concrete list after the demo meeting, but I don't think anything is a deal-breaker quite yet (unless no_std is broken, which should be an easy fix).
Anyway, there's quite a bit of documentation in the comments, so see that for more details!