Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Exception Class Reference

#include <Exception.h>

+ Inheritance diagram for Poco::Exception:
+ Collaboration diagram for Poco::Exception:

Public Member Functions

 Exception (const std::string &msg, int code=0)
 
 Exception (const std::string &msg, const std::string &arg, int code=0)
 Creates an exception.
 
 Exception (const std::string &msg, const Exception &nested, int code=0)
 Creates an exception.
 
 Exception (const Exception &exc)
 
 ~Exception () noexcept
 Copy constructor.
 
Exceptionoperator= (const Exception &exc)
 Destroys the exception and deletes the nested exception.
 
virtual const char * name () const noexcept
 Assignment operator.
 
virtual const char * className () const noexcept
 Returns a static string describing the exception.
 
virtual const char * what () const noexcept
 Returns the name of the exception class.
 
const Exceptionnested () const
 
const std::string & message () const
 
int code () const
 Returns the message text.
 
std::string displayText () const
 Returns the exception code if defined.
 
virtual Exceptionclone () const
 
virtual void rethrow () const
 

Protected Member Functions

 Exception (int code=0)
 
void message (const std::string &msg)
 Standard constructor.
 
void extendedMessage (const std::string &arg)
 Sets the message for the exception.
 

Private Attributes

std::string _msg
 Sets the extended message for the exception.
 
Exception_pNested
 
int _code
 

Detailed Description

This is the base class for all exceptions defined in the Poco class library.

Definition at line 28 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception() [1/5]

Poco::Exception::Exception ( const std::string & msg,
int code = 0 )

◆ Exception() [2/5]

Poco::Exception::Exception ( const std::string & msg,
const std::string & arg,
int code = 0 )

Creates an exception.

◆ Exception() [3/5]

Poco::Exception::Exception ( const std::string & msg,
const Exception & nested,
int code = 0 )

Creates an exception.

◆ Exception() [4/5]

Poco::Exception::Exception ( const Exception & exc)

Creates an exception and stores a clone of the nested exception.

◆ ~Exception()

Poco::Exception::~Exception ( )
noexcept

Copy constructor.

◆ Exception() [5/5]

Poco::Exception::Exception ( int code = 0)
protected

(Re)Throws the exception.

This is useful for temporarily storing a copy of an exception (see clone()), then throwing it again.

Member Function Documentation

◆ className()

virtual const char * Poco::Exception::className ( ) const
virtualnoexcept

Returns a static string describing the exception.

◆ clone()

virtual Exception * Poco::Exception::clone ( ) const
virtual

Returns a string consisting of the message name and the message text.

+ Here is the caller graph for this function:

◆ code()

int Poco::Exception::code ( ) const
inline

Returns the message text.

Definition at line 128 of file Exception.h.

◆ displayText()

std::string Poco::Exception::displayText ( ) const

Returns the exception code if defined.

+ Here is the caller graph for this function:

◆ extendedMessage()

void Poco::Exception::extendedMessage ( const std::string & arg)
protected

Sets the message for the exception.

◆ message() [1/2]

const std::string & Poco::Exception::message ( ) const
inline

Returns a pointer to the nested exception, or null if no nested exception exists.

Definition at line 116 of file Exception.h.

+ Here is the caller graph for this function:

◆ message() [2/2]

void Poco::Exception::message ( const std::string & msg)
inlineprotected

Standard constructor.

Definition at line 122 of file Exception.h.

◆ name()

virtual const char * Poco::Exception::name ( ) const
virtualnoexcept

Assignment operator.

◆ nested()

const Exception * Poco::Exception::nested ( ) const
inline

Returns a static string describing the exception.

Same as name(), but for compatibility with std::exception.

Definition at line 110 of file Exception.h.

◆ operator=()

Exception & Poco::Exception::operator= ( const Exception & exc)

Destroys the exception and deletes the nested exception.

◆ rethrow()

virtual void Poco::Exception::rethrow ( ) const
virtual

Creates an exact copy of the exception.

The copy can later be thrown again by invoking rethrow() on it.

◆ what()

virtual const char * Poco::Exception::what ( ) const
virtualnoexcept

Returns the name of the exception class.

Member Data Documentation

◆ _code

int Poco::Exception::_code
private

Definition at line 103 of file Exception.h.

◆ _msg

std::string Poco::Exception::_msg
private

Sets the extended message for the exception.

Definition at line 101 of file Exception.h.

◆ _pNested

Exception* Poco::Exception::_pNested
private

Definition at line 102 of file Exception.h.


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