Enhance error reporting