Capture exceptions
Merge pull request #2 from hojberg/capture_exceptions

Capture exceptions