improve error reporting on std::exceptions