Skip to content

Commit

Permalink
fix chronos v4 compatiblity
Browse files Browse the repository at this point in the history
`yield` has never worked correctly in chronos - removing broken
function.

Also, the "official" way of checking the state of the future is via
`failed`
  • Loading branch information
arnetheduck committed Nov 17, 2023
1 parent fb4fce7 commit ea68670
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions chronicles/chronos_tools.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,5 @@ proc catchOrQuit*(error: Exception) =

proc traceAsyncErrors*(fut: FutureBase) =
fut.addCallback do (arg: pointer):
if not fut.error.isNil:
if fut.failed():
catchOrQuit fut.error[]

template traceAwaitErrors*(fut: FutureBase) =
let f = fut
yield f
if not f.error.isNil:
catchOrQuit f.error[]

0 comments on commit ea68670

Please sign in to comment.