Public Member Functions | Protected Attributes

CoreException Class Reference

#include <anope.h>

Inherited by ConfigException, ConvertException, DatabaseException, ModuleException, RegexException, and SocketException.

Collaboration diagram for CoreException:
Collaboration graph
[legend]

Public Member Functions

 CoreException ()
 CoreException (const Anope::string &message)
 CoreException (const Anope::string &message, const Anope::string &src)
virtual ~CoreException () throw ()
virtual const Anope::stringGetReason () const
virtual const Anope::stringGetSource () const

Protected Attributes

Anope::string err
Anope::string source

Detailed Description

This class can be used on its own to represent an exception, or derived to represent a module-specific exception. When a module whishes to abort, e.g. within a constructor, it should throw an exception using ModuleException or a class derived from ModuleException. If a module throws an exception during its constructor, the module will not be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.

Definition at line 637 of file anope.h.


Constructor & Destructor Documentation

CoreException::CoreException (  )  [inline]

Default constructor, just uses the error mesage 'Core threw an exception'.

Definition at line 649 of file anope.h.

CoreException::CoreException ( const Anope::string message  )  [inline]

This constructor can be used to specify an error message before throwing.

Definition at line 652 of file anope.h.

CoreException::CoreException ( const Anope::string message,
const Anope::string src 
) [inline]

This constructor can be used to specify an error message before throwing, and to specify the source of the exception.

Definition at line 656 of file anope.h.

virtual CoreException::~CoreException (  )  throw () [inline, virtual]

This destructor solves world hunger, cancels the world debt, and causes the world to end. Actually no, it does nothing. Never mind.

Exceptions:
Nothing! 

Definition at line 661 of file anope.h.


Member Function Documentation

virtual const Anope::string& CoreException::GetReason (  )  const [inline, virtual]
virtual const Anope::string& CoreException::GetSource (  )  const [inline, virtual]

Definition at line 670 of file anope.h.

References source.


Field Documentation

Holds the error message to be displayed

Definition at line 642 of file anope.h.

Referenced by GetReason().

Source of the exception

Definition at line 645 of file anope.h.

Referenced by GetSource().


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