ScummVM API documentation
Common::Error Class Reference

#include <error.h>

Public Member Functions

 Error (ErrorCode code=kUnknownError)
 
 Error (ErrorCode code, const String &extra)
 
String getDesc () const
 
U32String getTranslatedDesc () const
 
ErrorCode getCode () const
 

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.

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.

◆ 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.

Member Function Documentation

◆ getDesc()

String Common::Error::getDesc ( ) const

Get the untranslated description of this error.

◆ getTranslatedDesc()

U32String Common::Error::getTranslatedDesc ( ) const

Get the translated description of this error.

◆ getCode()

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

Get the error code of this error.

Member Data Documentation

◆ _code

ErrorCode Common::Error::_code
protected

Error code.

◆ _desc

String Common::Error::_desc
protected

Error description.


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