fixes for exception handling; added system.compileOption
This commit is contained in:
parent
030d46f218
commit
866572e2e4
18 changed files with 329 additions and 165 deletions
21
tests/accept/run/tcontinuexc.nim
Normal file
21
tests/accept/run/tcontinuexc.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
type
|
||||
ESomething = object of E_Base
|
||||
ESomeOtherErr = object of E_Base
|
||||
|
||||
proc genErrors(s: string) =
|
||||
if s == "error!":
|
||||
raise newException(ESomething, "Test")
|
||||
else:
|
||||
raise newException(EsomeotherErr, "bla")
|
||||
|
||||
try:
|
||||
for i in 0..3:
|
||||
try:
|
||||
genErrors("error!")
|
||||
except ESomething:
|
||||
echo("Error happened")
|
||||
echo "came here"
|
||||
raise newException(EsomeotherErr, "bla")
|
||||
finally:
|
||||
echo "caught"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue