reduce compiler warnings

This commit is contained in:
jangko 2023-02-14 17:58:39 +07:00 committed by Diego
parent 3f5c8dcfa7
commit eae7f92d5c
No known key found for this signature in database
GPG Key ID: C9DAC9BF68D1F806
1 changed files with 2 additions and 7 deletions

View File

@ -1083,25 +1083,20 @@ template test*(nameParam: string, body: untyped) =
try:
when declared(testSetupIMPLFlag): testSetupIMPL()
block:
when (NimMajor, NimMinor) >= (1, 6):
{.warning[BareExcept]:off.}
try:
body
except Exception as eBody:
except CatchableError as eBody:
try:
when declared(testTeardownIMPLFlag):
testTeardownIMPL()
except Exception as eTeardown:
except CatchableError as eTeardown:
eTeardown.parent = eBody
raise eTeardown
raise eBody
when declared(testTeardownIMPLFlag):
testTeardownIMPL()
when (NimMajor, NimMinor) >= (1, 6):
{.warning[BareExcept]:on.}
except CatchableError as e:
let eTypeDesc = "[" & $e.name & "]"
checkpoint("Unhandled error: " & e.msg & " " & eTypeDesc)