Closed SUPERCILEX closed 1 year ago
I think at this time we should wait for it to mature more before re-evaluating which error library we are using. A lot is changing within the error landscape atm with the provider API, termination trait work, etc.
Fair enough :+1:
I just migrated and it's much nicer: https://github.com/SUPERCILEX/ftzz/commit/60b73258cc387bb29a643eebc21bcf54af4d21a3. The key difference is that context transitions are backed by the type system. That is, instead of specifying context-free error messages at the call site where they will be duplicated (with
.context()
), you specify the error message through the Display function of your error type on a context transition (with.change_context()
). So.context("Failed to retrieve task result")
turns into.change_context(Error::TaskJoin)
with#[error("Failed to retrieve subtask results.")] TaskJoin
.