-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Thanks to Chronos v4 supports proper raises tracking, it now makes more sense to use exception tracking and specifically also custom errors to correctly signal error types.
I have a custom error type, that I have correctly added to raises and created for it specific Result type like this:
type
SubscriptionError* = object of EthersError
SubscriptionResult*[E] = Result[E, ref SubscriptionError]
When I used it with Questionable like this:
proc onBlock(blckResult: SubscriptionResult[Block]) =
without blck =? blckResult, err:
raise err
Then I got an error from Nim that points out that the raised error is ref CatchableError type and not ref SubscriptionError. If I use the Result's API directly, then the expected error is correctly ref SubscriptionError
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels