mirror of https://github.com/status-im/nim-eth.git
13 lines
364 B
Nim
13 lines
364 B
Nim
import
|
|
chronos/asyncfutures2, chronicles
|
|
|
|
proc traceAsyncErrors*(fut: FutureBase) =
|
|
fut.addCallback do (arg: pointer):
|
|
if not fut.error.isNil:
|
|
if fut.error[] of CatchableError:
|
|
trace "Async operation ended with a recoverable error", err = fut.error.msg
|
|
else:
|
|
fatal "Fatal exception reached", err = fut.error.msg
|
|
quit 1
|
|
|