ErrorReporter#

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 ErrorReporterPrivate#

Public Functions

bool isMainAircraftPath(const std::string &path) const#

heuristic to identify relative paths as origination from the main aircraft as opposed to something else. This is based on containing the aircraft directory name.

bool isAnyAircraftPath(const std::string &path) const#

helper to determine if a file looks like it belongs to an aircraft.

This is used to detect potential cross-aircraft packaging bugs which often lead to ‘not found’ error reports. So we’re looking for paths which look plausibly like any aircraft path, even though isMainAircraftPath didn’t match on them.

AggregateErrors::iterator getAggregateForOccurence(const ErrorOcurrence &oc)#

find the appropriate agrgegate for an error, based on its context

bool reportIsOngoing(const AggregateReport &report) const#

check if the report is still adding new errors, we avoid showing the UI until all the errors are collected/

Public Members

string_list _significantProperties#

properties we want to include in reports, for debugging

struct AggregateReport#

structure representing one or more errors, aggregated together

This is what we send to Sentry, or present to the user, after combining occurrences from the same / related sources, or duplicates.

Public Members

std::string parameter#

base on type, the specific point. For example the add-on ID, AI model ident or custom scenery path

struct ErrorOcurrence#

structure representing a single error which has occurred

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.