improve error reporting on debug True