Exit with exit code 1 if an exception is thrown