Instead of catching the error message, we should copy the exception pointer and store the exception itself, to be rethrown from the calling thread at the appropriate moment.