mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-05-10 04:09:48 +00:00
chore: remove CatchableError (#19)
This commit is contained in:
parent
e3eca63236
commit
37d19c0687
@ -163,8 +163,8 @@ proc processRequest[T](
|
||||
let res =
|
||||
try:
|
||||
await retFut
|
||||
except CatchableError as exc:
|
||||
Result[string, string].err("Exception in processRequest for " & reqId & ": " & exc.msg)
|
||||
except AsyncError as exc:
|
||||
Result[string, string].err("Async error in processRequest for " & reqId & ": " & exc.msg)
|
||||
|
||||
## handleRes may raise (OOM, GC setup) even though it is rare. Catching here
|
||||
## keeps the async proc raises:[] compatible. The defer inside handleRes
|
||||
|
||||
@ -58,7 +58,7 @@ proc writeAndFlush(f: syncio.File, s: LogOutputStr) =
|
||||
try:
|
||||
f.write(s)
|
||||
f.flushFile()
|
||||
except CatchableError:
|
||||
except IOError:
|
||||
logLoggingFailure(cstring(s), getCurrentException())
|
||||
|
||||
## Setup
|
||||
@ -99,7 +99,7 @@ proc setupLog*(level: LogLevel, format: LogFormat) =
|
||||
let color =
|
||||
try:
|
||||
not parseBool(os.getEnv("NO_COLOR", "false"))
|
||||
except CatchableError:
|
||||
except ValueError:
|
||||
true
|
||||
|
||||
setupLogLevel(level)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user