Added detection of caught exceptions so exit value is correct.
Merge pull request #98 from jbake-org/set-return-code-for-error

Added detection of caught exceptions so exit value is correct.