diff options
author | Andreas Rumpf <andreas@andreas-laptop> | 2010-05-28 23:33:29 +0200 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-laptop> | 2010-05-28 23:33:29 +0200 |
commit | b34b1dbc6c7290a893149aa9f5ea5d54a37c8522 (patch) | |
tree | d61f14d6f56eab37178242b61c83fdbbd87db30d /tests/accept/run/treraise.nim | |
parent | 6c2050912166a4960b40c3825afb1a31cfdde0eb (diff) | |
download | Nim-b34b1dbc6c7290a893149aa9f5ea5d54a37c8522.tar.gz |
added tests
Diffstat (limited to 'tests/accept/run/treraise.nim')
-rw-r--r-- | tests/accept/run/treraise.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/accept/run/treraise.nim b/tests/accept/run/treraise.nim new file mode 100644 index 000000000..60b8640c4 --- /dev/null +++ b/tests/accept/run/treraise.nim @@ -0,0 +1,17 @@ +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") + +while True: + try: + genErrors("errssor!") + except ESomething: + echo("Error happened") + except: + raise |