Improve error reporting on exception