HydraExpress™ C++ 2020 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
The base class for all exceptions in the rwsf
namespace.
More...
#include <rwsf/core/Exception.h>
Public Member Functions | |
Exception (const ExceptionInfo &eInfo) | |
Exception (const char *msg) | |
Exception (const std::string &msg) | |
Exception (const rwsf::ExceptionInfo &eInfo, const LocalizedMessage &msg) | |
Exception (const Exception &) | |
virtual | ~Exception () throw () |
virtual Exception * | clone (void) const |
const char * | getFileName () const |
const char * | getFunctionName () const |
unsigned long | getLineNumber () const |
virtual bool | operator!= (const Exception exc2) |
Exception & | operator= (const Exception &m) |
virtual bool | operator== (const Exception exc2) |
virtual void | raise (void) const |
virtual const char * | what () const throw () |
Related Functions | |
(Note that these are not member functions.) | |
#define | RWSF_DECLARE_EXCEPTION_METHODS(className) |
#define | RWSF_DEFINE_EXCEPTION_METHODS(className) |
#define | RWSF_EINFO |
The base class for all exceptions in the rwsf
namespace, rwsf::Exception derives from std::exception and can be caught as a base class. It can also be introspected for the message, and (if rwsf::ExceptionInfo is used) for the source file, function, and line the exception occurred on.
Example of catching an exception:
Example of throwing an exception with a simple string:
Example of throwing an exception with a localized message (see rwsf::LocalizedMessage):
rwsf::Exception::Exception | ( | const ExceptionInfo & | eInfo | ) |
Constructs a basic exception with no message. This exception reports the information provided in eInfo (file name, function, and line number).
rwsf::Exception::Exception | ( | const char * | msg | ) |
Constructs a basic exception with the given message msg. This message is not localized, and any file, function, and line info will be blank (or 0).
rwsf::Exception::Exception | ( | const std::string & | msg | ) |
Constructs a basic exception with the given message msg. This message is not localized, and any file, function, and line info will be blank (or 0).
rwsf::Exception::Exception | ( | const rwsf::ExceptionInfo & | eInfo, |
const LocalizedMessage & | msg | ||
) |
Constructs a basic exception with the given message msg. This exception reports the information provided in eInfo (file name, function, line number).
rwsf::Exception::Exception | ( | const Exception & | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Creates a new copy of self on the heap. Overridden in derived classes to construct an instance of the correct derived type. It is up to the user to ensure that the returned Exception object is deleted.
Reimplemented in rwsf::XmlParseLineColException, rwsf::ServletUnavailableException, rwsf::ServiceShutdownException, rwsf::XmlParseException, rwsf::NamingException, rwsf::LoggerException, rwsf::XmlParseAttributeNotFoundException, rwsf::XmlException, rwsf::OutOfBoundsException, rwsf::NotImplementedException, rwsf::NullPointerException, rwsf::XmlSchemaException, and rwsf::ServletException.
const char* rwsf::Exception::getFileName | ( | ) | const |
Returns a char*
containing the file name associated with the exception when the exception was constructed. This method may return an empty string if the file name was not specified.
const char* rwsf::Exception::getFunctionName | ( | ) | const |
Returns a char*
containing the function name associated with the exception when it was constructed. This method may return an empty string if the function name was not specified.
unsigned long rwsf::Exception::getLineNumber | ( | ) | const |
Returns the line number associated with the exception when it was constructed. This method returns 0 if the line number was not specified.
|
virtual |
Comparison operator.
Assignment operator. Makes self a deep copy of m.
|
virtual |
Comparison operator.
|
virtual |
Throws self. Overridden in derived classes to throw the correct derived type.
Reimplemented in rwsf::XmlParseLineColException, rwsf::ServletUnavailableException, rwsf::ServiceShutdownException, rwsf::XmlParseException, rwsf::NamingException, rwsf::LoggerException, rwsf::XmlParseAttributeNotFoundException, rwsf::XmlException, rwsf::OutOfBoundsException, rwsf::NotImplementedException, rwsf::NullPointerException, rwsf::XmlSchemaException, and rwsf::ServletException.
|
virtual |
Returns a char*
containing the exception message.
|
related |
Declares the member functions raise() and clone() on derived exception classes so that they act on an appropriate derived exception class instance.
RWSF_DECLARE_EXCEPTION_METHODS() should be included in the class declaration of a derived exception class.
|
related |
Defines the member functions raise() and clone() on derived exception classes so that they act on an appropriate derived exception class instance.
RWSF_DEFINE_EXCEPTION_METHODS() should be included in the source file where the derived exception class is defined.
|
related |
Macro created to return system information related to section of code where an exception was thrown:
Set to return information depending upon platform of the machine running the application.
Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved. |