You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to catch specific exception in runnableExamples, as it causes nim doc to fail, however, a general except works fine.
Example
# this proc on its own works fine with `nim doc`procgoodProc*() =
runnableExamples:
try:
discardexcept:
# just the general except will workdiscard# this proc fails with `nim doc`procbadProc*() =
runnableExamples:
try:
discardexceptIOError:
# specifying Error is culpritdiscard
Current Output
/tmp/project # nim doc runnableExcept.nim
Hint: used config file '/nim/config/nim.cfg' [Conf]
Hint: used config file '/nim/config/nimdoc.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: runnableExcept [Processing]
fatal.nim(39) sysFatal
Error: unhandled exception: sempass2.nim(394, 19) `b.sons[j].kind == nkType` [AssertionError]
Additional Information
A working alternative is to import unittest and utilize expect
$ nim -v
Nim Compiler Version 1.0.2 [Linux: amd64]
Compiled at 2019-10-22
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: 193b3c66bbeffafaebff166d24b9866f1eaaac0e
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
Unable to catch specific exception in
runnableExamples
, as it causesnim doc
to fail, however, a general except works fine.Example
Current Output
Additional Information
import unittest
and utilize expectThe text was updated successfully, but these errors were encountered: