Araq/Nimrod — Issue #99: Try statement doesn't catch exception
Author: dom96
Created: 2012-02-11 19:42:21+00:00
State: open

The following code:

```nimrod
import re
proc blah(): tuple[first, last: int] =
try:
return re.findBounds("blah", re("*****"), 0)
except:
return (-1, 0)

echo blah()
```

Results in:

```
Traceback (most recent call last)
catchexcbug.nim(8) catchexcbug
catchexcbug.nim(4) blah
re.nim(75) re
re.nim(60) rawCompile
re.nim(52) raiseInvalidRegex
Error: unhandled exception: nothing to repeat
*****
^
[EInvalidRegEx]
```

It seems that the `return` causes this. Using `result` seems to work.