A collection of functions used to report information about a crash.
#include <utility/YiCrashHandler.h>
Classes | |
class | PostData |
A container for information required to make a POST request. More... | |
Static Public Member Functions | |
static void | AddAppDataValue (const CYIString &key, const CYIString &value) |
static CYIString | GetAppDataValue (const CYIString &key) |
static void | ClearAppData () |
static void | PreallocateMinidumpFilenameStorage () |
static void | ReplacePlaceholderWithMinidumpFilename (CYIStringView filename, CYIString *pJSON) |
static void | ReplacePlaceholderWithTimestamp (CYIString *pJSON) |
static void | ReplacePlaceholders (CYIStringView minidumpFilename, CYIString *pJSON) |
static const CYIString & | GetCrashReport () |
static void | ReportFatalError (const CYIString &callStack) |
static CYIString | GetCallStack () |
static void | SetCrashReportPostData (const PostData &data) |
static const PostData & | GetCrashReportPostData () |
static void | SetMinidumpPostData (const PostData &data) |
static const PostData & | GetMinidumpPostData () |
static void | SetEngineInformation () |
static void | SetDeviceInformation () |
static void | UpdateRenderingSurfaceData (const CYIRenderingSurfaceInfo &surface) |
Static Public Attributes | |
static const CYIStringView | s_quotedUnixTimestampMsPlaceholder |
static CYISignal | CrashReportChanged |
static CYISignal | CrashReportPostDataChanged |
static CYISignal | MinidumpPostDataChanged |
static CYISignal | FatalErrorOccurred |
Static Protected Member Functions | |
static void | ResetCrashReportForTesting () |
Static Protected Attributes | |
static const CYIStringView | s_quotedUnixTimestampMsForReplacement |
static constexpr const char * | s_pMinidumpFilenameKey = "minidump_filename" |
Friends | |
class | CYICrashHandlerPlatform |
|
static |
Adds app data as a key-value pair. This data will be available as part of the JSON document returned by CYICrashHandler::GetCrashReport.
If key already exists in the stored app data, the current value associated with key will be overwritten with value.
|
static |
Removes all stored app data values.
Returns the value associated with key.
|
static |
Returns the call stack included when a fatal error is manually triggered using CYICrashHandler::ReportFatalError.
|
static |
Returns the crash report which contains relevant data for the crash. This function does not allocate memory and is safe to call during or after a crash.
|
static |
Returns the crash report PostData which contains specific data required to upload the crash payload.
|
static |
Returns the minidump post request data which contains specific data required to upload the crash minidump.
|
static |
Pre-allocates memory to store a minidump filename. This function is called internally by the crash handler.
|
static |
Given the JSON string pJSON, replaces all known placeholders with their appropriate values.
|
static |
Given the JSON string pJSON, replaces the minidump filename placeholder with filename. The path portion of the filename is stripped out, if it exists.
|
static |
Given the JSON string pJSON, replaces the timestamp placeholders with the current time. The format used for the time depends on the placeholder used. If timestamp placeholders cannot be found in pJSON, this function does nothing.
|
static |
Triggers crash handling for a fatal error in the app that does not result in a crash. The argument callStack is available as part of the JSON document returned by CYICrashHandler::GetCrashReport.
|
staticprotected |
Resets crash report values for the purposes of automated testing.
|
static |
|
static |
Adds device information to the crash report. This data will be available as part of the JSON document returned by CYICrashHandler::GetCrashReport.
|
static |
Adds engine information to the crash report. This data will be available as part of the JSON document returned by CYICrashHandler::GetCrashReport.
|
static |
Sets minidump POST request data. data is available as CYICrashHandler::GetMinidumpPostData.
Example usage:
|
static |
Updates rendering surface data in the crash report. If the data does not exist in the crash report, it is added for the first time. This data will be available as part of the JSON document returned by CYICrashHandler::GetCrashReport.
|
friend |
|
static |
A signal called whenever any of the crash report data changes.
|
static |
A signal called whenever a crash report's PostData changes.
|
static |
A signal called whenever a fatal error is reported by app or platform code.
|
static |
A signal called whenever a crash minidump's PostData changes.
|
staticprotected |
The minidump filename key
|
staticprotected |
A placeholder string that can be inserted into JSON payloads. At crash-time, it will be replaced with the unix epoch (in milliseconds).
|
static |
A placeholder string that can be inserted into JSON payloads. At crash-time, it will be replaced with the unix epoch (in milliseconds). Quotes around the placeholder will be removed.
For example, given the following payload:
the payload will be modified at crash time to include the current unix epoch time (in milliseconds):