You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cause is an unnecessary construct I think.
Why not just point to another relevant error?
So we just get a linked list.
All relevant error constructs should implement error, so they behave like any other error in Rust, making it easier to use the library.
We can use the thiserror crate
Proposed change
Remove Cause struct.
Change WithCause trait to WithErr<T>, for relevant errors
Make ParseErr and LexErr derive Error
Make TypeErr and derive Error
Introduce new TypeErr struct which has internal vector of TypeErrs
Let this struct also derive Error.
If we add a new method which behaves similar to the new of TypeErr, we can use this in all situations where we have to manually construct a vector of errors.
Make UnimplementedErr derive Error
The text was updated successfully, but these errors were encountered:
Summary of current issue
Error implementation could be made more elegant:
Cause
is an unnecessary construct I think.Why not just point to another relevant error?
So we just get a linked list.
We can use the thiserror crate
Proposed change
Cause
struct.WithCause
trait toWithErr<T>
, for relevant errorsParseErr
andLexErr
deriveError
TypeErr
and deriveError
TypeErr
struct which has internal vector ofTypeErrs
Let this struct also derive
Error
.If we add a
new
method which behaves similar to thenew
ofTypeErr
, we can use this in all situations where we have to manually construct a vector of errors.UnimplementedErr
deriveError
The text was updated successfully, but these errors were encountered: