ScummVM
Common::Error Class Reference

An Error instance pairs an error code with string description providing more details about the error. More...

#include <error.h>

Collaboration diagram for Common::Error:

Public Member Functions

 Error (ErrorCode code=kUnknownError)
 Construct a new Error with the specified error code and the default error message. More...
 
 Error (ErrorCode code, const String &extra)
 Construct a new Error with the specified error code and an augmented error message. More...
 
const StringgetDesc () const
 Get the description of this error. More...
 
ErrorCode getCode () const
 Get the error code of this error. More...
 

Protected Attributes

ErrorCode _code
 
String _desc
 

Detailed Description

An Error instance pairs an error code with string description providing more details about the error.

For every error code, a default description is provided, but it is possible to optionally augment that description with extra information when creating a new Error instance.

Definition at line 77 of file error.h.

Constructor & Destructor Documentation

◆ Error() [1/2]

Common::Error::Error ( ErrorCode  code = kUnknownError)

Construct a new Error with the specified error code and the default error message.

Definition at line 81 of file error.cpp.

◆ Error() [2/2]

Common::Error::Error ( ErrorCode  code,
const String extra 
)

Construct a new Error with the specified error code and an augmented error message.

Specifically, the provided extra text is suitably appended to the default message.

Definition at line 85 of file error.cpp.

Member Function Documentation

◆ getCode()

ErrorCode Common::Error::getCode ( ) const
inline

Get the error code of this error.

Definition at line 103 of file error.h.

◆ getDesc()

const String& Common::Error::getDesc ( ) const
inline

Get the description of this error.

Definition at line 98 of file error.h.

Member Data Documentation

◆ _code

ErrorCode Common::Error::_code
protected

Definition at line 79 of file error.h.

◆ _desc

String Common::Error::_desc
protected

Definition at line 80 of file error.h.


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