small improvement to error handling for tests

Now, if there was an exception it includes that in the output