Application Error Context

Interface

class ApplicationErrorContext

Generic additional data to extend application reporting.

Public Functions

inline ApplicationErrorContext(text::String title, text::String description, const unit::ExitCode exitCode = unit::ExitCode::failure())

Create an error context with details for error reporting.

Parameters:
  • title – The title for the error, which is also the error reason.

  • description – A detailed description of the error.

  • exitCode – The exit code if this exception ends the current application.

inline ApplicationErrorContext(text::String title, const unit::ExitCode exitCode = unit::ExitCode::failure())

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

inline ApplicationErrorContext(const unit::ExitCode exitCode = unit::ExitCode::failure())

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

inline const text::String &title() const noexcept

Get the title of the error.

inline ApplicationErrorContext &setTitle(text::String title) noexcept

Set the title of the error.

inline const text::String &description() const noexcept

Get the description of the error.

inline ApplicationErrorContext &setDescription(text::String description) noexcept

Set the description of the error.

inline const text::String &sourceName() const noexcept

Get the name of the source that caused the error.

inline ApplicationErrorContext &setSourceName(text::String sourceName) noexcept

Set the name of the source that caused the error.

inline const text::String &sourcePath() const noexcept

Get the path of the source that caused the error.

inline ApplicationErrorContext &setSourcePath(text::String sourcePath) noexcept

Set the path of the source that caused the error.

inline unit::CodeLocation codeLocation() const noexcept

Get the code location of the source that caused the error.

inline ApplicationErrorContext &setCodeLocation(const unit::CodeLocation codeLocation) noexcept

Set the code location of the source that caused the error.

inline unit::ExitCode exitCode() const noexcept

Get the exit code to end the application.

inline ApplicationErrorContext &setExitCode(const unit::ExitCode exitCode) noexcept

Set the exit code to end the application.