This commit is contained in:
Araq 2012-02-17 20:19:14 +01:00
commit a13a14327a
2 changed files with 37 additions and 6 deletions

30
tests/run/texcpt1.nim Normal file
View file

@ -0,0 +1,30 @@
discard """
outputsub: "-6"
"""
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")
proc raiseBla(): int =
try:
genErrors("errssor!")
except ESomething:
echo("Error happened")
except:
raise
proc blah(): int =
try:
result = raiseBla()
except ESomeOtherErr:
result = -6
echo blah()