Add better error reporting, tracing the causes of exceptions.