Error reporting classes#

/sim/error-reporter/enabled#

Controls whether the in-simulation error-reporting dialog is shown when non-fatal errors are encountered. Set to false to suppress the dialog.

enum class simgear::LoadFailure#

kinds of failures we can report. This is how (or why) something failed. Extend as necessary but update the corresponding string translations if you do. More detail isn’t necessarily useful here: better to provide that in the ‘details’ string

Values:

enumerator Unknown#
enumerator NotFound#
enumerator OutOfMemory#
enumerator BadHeader#
enumerator BadData#
enumerator Misconfigured#
enumerator IOError#
enumerator NetworkError#
enum class simgear::ErrorCode#

enum of the operations which can fail. This should be extended as necessary: it maps to translated error messages for the user. This describes what failed, the enum above gives why/how. The combination of what+why should be something at the user level: use details for debug-level information.

Values:

enumerator LoadEffectsShaders#
enumerator LoadingTexture#
enumerator XMLModelLoad#
enumerator ThreeDModelLoad#
enumerator BTGLoad#
enumerator ScenarioLoad#
enumerator GUIDialog#
enumerator AudioFX#
enumerator XMLLoadCommand#
enumerator AircraftSystems#
enumerator InputDeviceConfig#
enumerator AITrafficSchedule#
enumerator TerraSync#
class ErrorReporter : public SGSubsystem#
class ErrorReportContext#

Define an error-reporting context value, for the duration of this object’s lifetime. The context value will be active for any errors occurring on the same thread, while this object exists.

Public Functions

ErrorReportContext(const ContextMap &context = {})#

Allow establishing multiple context values in a single operation

void addFromMap(const ContextMap &context)#

allowed delayed add of values

void simgear::reportFailure(LoadFailure type, ErrorCode code, const std::string &detailedMessage = {}, sg_location loc = {})#

Report failure to load a resource, so they can be collated for reporting to the user.

Parameters:
  • type – - the reason for the failure, if it can be determined

  • msg – - an informational message about what caused the failure

  • path – - path on disk to the resource. In some cases this may be a relative path; especially in the case of a resource not found, we cannot report a file path.