DeskUp 0.3
Loading...
Searching...
No Matches
DeskUp::Error Class Referencefinal

Centralized representation of a DeskUp runtime error. More...

#include <desk_up_error.h>

Inheritance diagram for DeskUp::Error:
Collaboration diagram for DeskUp::Error:

Public Member Functions

 Error ()
 Default constructor (represents a non-error).
 Error (Level l, ErrType err, unsigned int t, std::string msg)
 Constructs an error with full metadata.
ErrType type () const noexcept
 Returns the error type.
Level level () const noexcept
 Returns the error severity level.
int attempts () const noexcept
 Returns how many times the operation was retried.
windowDesc whichWindow () const noexcept
 Returns the affected window (if available).
bool isFatal () const noexcept
 Whether the error is fatal.
bool isSkippable () const noexcept
 Whether the error is skipable.
bool isWarning () const noexcept
 Whether the error is a warning.
bool isError () const noexcept
 Whether the error is a system error.
bool isRetryable () const noexcept
 Whether the error can be retried.
 operator bool () const noexcept
 Converts to true if this instance represents an actual error.

Static Public Member Functions

static Error fromSaveError (int e)
 Converts a SaveErrorCode (from window_desc.cc) into a structured error.

Detailed Description

Centralized representation of a DeskUp runtime error.

The Error class extends std::runtime_error to attach structured metadata to exceptions thrown across DeskUp subsystems. Each error carries:

  • A Level (severity classification)
  • An ErrType (category)
  • The number of retries attempted (if applicable)
  • An optional windowDesc structure indicating the affected window

Conversion utilities (fromLastWinError(), fromSaveError()) map Windows system errors and DeskUp-specific codes to structured Error instances.

See also
Level
ErrType
windowDesc
Version
0.2.1
Date
2025

Constructor & Destructor Documentation

◆ Error() [1/2]

DeskUp::Error::Error ( )
inline

Default constructor (represents a non-error).

Version
0.2.1
Date
2025
Here is the caller graph for this function:

◆ Error() [2/2]

DeskUp::Error::Error ( Level l,
ErrType err,
unsigned int t,
std::string msg )
inline

Constructs an error with full metadata.

Parameters
lError level (severity).
errError type (category).
tNumber of retries attempted before failure.
msgDescriptive error message.
Version
0.2.1
Date
2025

Member Function Documentation

◆ attempts()

int DeskUp::Error::attempts ( ) const
inlinenoexcept

Returns how many times the operation was retried.

Returns
Integer representing the retry count.

◆ fromSaveError()

DeskUp::Error DeskUp::Error::fromSaveError ( int e)
static

Converts a SaveErrorCode (from window_desc.cc) into a structured error.

Parameters
eInteger error code returned by a save operation.
Returns
A structured Error describing the save failure.
Version
0.2.1
Date
2025
Here is the call graph for this function:
Here is the caller graph for this function:

◆ level()

Level DeskUp::Error::level ( ) const
inlinenoexcept

Returns the error severity level.

Returns
The associated Level.
Here is the caller graph for this function:

◆ type()

ErrType DeskUp::Error::type ( ) const
inlinenoexcept

Returns the error type.

Returns
The associated ErrType.

◆ whichWindow()

windowDesc DeskUp::Error::whichWindow ( ) const
inlinenoexcept

Returns the affected window (if available).

Returns
A windowDesc associated with this error.

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