Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
audacity::sentry::Exception Struct Referencefinal

A DTO for the Sentry Exception interface. More...

#include <SentryReport.h>

Collaboration diagram for audacity::sentry::Exception:
[legend]

Public Member Functions

ExceptionAddData (std::string key, AnonymizedMessage value)
 Add a payload to the exception. More...
 

Static Public Member Functions

static Exception Create (std::string type, AnonymizedMessage value)
 Create a new exception. More...
 
static Exception Create (AnonymizedMessage value)
 Create a new exception with type runtime_error. More...
 

Public Attributes

std::string Type
 Exception type. Should not have spaces. More...
 
AnonymizedMessage Value
 Message, associated with the Exception. More...
 
std::vector< ExceptionDataData
 Arbitrary payload. More...
 

Detailed Description

A DTO for the Sentry Exception interface.

Definition at line 30 of file SentryReport.h.

Member Function Documentation

◆ AddData()

Exception & audacity::sentry::Exception::AddData ( std::string  key,
AnonymizedMessage  value 
)

Add a payload to the exception.

Definition at line 238 of file SentryReport.cpp.

239{
240 Data.emplace_back(std::move(key), std::move(value));
241 return *this;
242}
static const AudacityProject::AttachedObjects::RegisteredFactory key
std::vector< ExceptionData > Data
Arbitrary payload.
Definition: SentryReport.h:37

References Data, and key.

Referenced by ErrorReportDialog::ErrorReportDialog().

Here is the caller graph for this function:

◆ Create() [1/2]

Exception audacity::sentry::Exception::Create ( AnonymizedMessage  value)
static

Create a new exception with type runtime_error.

Definition at line 233 of file SentryReport.cpp.

234{
235 return { "runtime_error", std::move(value) };
236}

◆ Create() [2/2]

Exception audacity::sentry::Exception::Create ( std::string  type,
AnonymizedMessage  value 
)
static

Create a new exception.

Definition at line 224 of file SentryReport.cpp.

225{
226 std::replace_if(type.begin(), type.end(), [](char c) {
227 return std::isspace(c) != 0;
228 }, '_');
229
230 return { std::move(type), std::move(value) };
231}

Referenced by ErrorReportDialog::ErrorReportDialog().

Here is the caller graph for this function:

Member Data Documentation

◆ Data

std::vector<ExceptionData> audacity::sentry::Exception::Data

Arbitrary payload.

Definition at line 37 of file SentryReport.h.

Referenced by AddData(), and audacity::sentry::anonymous_namespace{SentryReport.cpp}::SerializeException().

◆ Type

std::string audacity::sentry::Exception::Type

Exception type. Should not have spaces.

Definition at line 33 of file SentryReport.h.

Referenced by audacity::sentry::anonymous_namespace{SentryReport.cpp}::SerializeException().

◆ Value

AnonymizedMessage audacity::sentry::Exception::Value

The documentation for this struct was generated from the following files: