Wrap exception to retain the stack trace.
Improved some logging messages.
Merge pull request #82 from gertjvr/CaptureStackTrace

Small enhancement to aid with debugging.