From ea686704f420186a2ce23e2cb312d39ef6b2727f Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 17 Nov 2023 08:54:21 +0100 Subject: [PATCH] fix chronos v4 compatiblity `yield` has never worked correctly in chronos - removing broken function. Also, the "official" way of checking the state of the future is via `failed` --- chronicles/chronos_tools.nim | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/chronicles/chronos_tools.nim b/chronicles/chronos_tools.nim index 88a27f2..266e41a 100644 --- a/chronicles/chronos_tools.nim +++ b/chronicles/chronos_tools.nim @@ -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[] -