Improve diagnostic output on exception.