Closed Bulat-Ziganshin closed 1 year ago
Yes, not having a $ for errors is annoying. I ran into this a while ago myself.
I tried adding the following to results.nim:
proc `$`*(error: ref CatchableError): string =
error.msg
But this somehow breaks an unrelated test for catch
.
Root cause seems to be this issue in nim-result
.
When we have
x : ?!T
and usex.expect(...)
, we don't see x.e.msg in the raised exception because this code tries to use $(x.e) which is undefined for ResultFailureSee example in https://github.com/status-im/nim-codex/pull/160#issuecomment-1201753390