Poco

class Exception

Library: Foundation
Package: Core
Header: Poco/Exception.h

Description

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

Inheritance

Direct Base Classes: std::exception

All Base Classes: std::exception

Known Derived Classes: LogicException, AssertionViolationException, NullPointerException, BugcheckException, InvalidArgumentException, NotImplementedException, RangeException, IllegalStateException, InvalidAccessException, SignalException, UnhandledException, RuntimeException, NotFoundException, ExistsException, TimeoutException, SystemException, RegularExpressionException, LibraryLoadException, LibraryAlreadyLoadedException, NoThreadAvailableException, PropertyNotSupportedException, PoolOverflowException, NoPermissionException, OutOfMemoryException, DataException, DataFormatException, SyntaxException, CircularReferenceException, PathSyntaxException, IOException, FileException, FileExistsException, FileNotFoundException, PathNotFoundException, FileReadOnlyException, FileAccessDeniedException, CreateFileException, OpenFileException, WriteFileException, ReadFileException, UnknownURISchemeException, ApplicationException, BadCastException, Poco::Net::SSLException, Poco::Net::SSLContextException, Poco::Net::InvalidCertificateException, Poco::Net::NetException, Poco::Net::InvalidAddressException, Poco::Net::ServiceNotFoundException, Poco::Net::ConnectionAbortedException, Poco::Net::ConnectionResetException, Poco::Net::ConnectionRefusedException, Poco::Net::DNSException, Poco::Net::HostNotFoundException, Poco::Net::NoAddressFoundException, Poco::Net::InterfaceNotFoundException, Poco::Net::NoMessageException, Poco::Net::MessageException, Poco::Net::MultipartException, Poco::Net::HTTPException, Poco::Net::NotAuthenticatedException, Poco::Net::UnsupportedRedirectException, Poco::Net::FTPException, Poco::Net::SMTPException, Poco::Net::POP3Exception, Poco::Net::ICMPException, Poco::Util::UnknownOptionException, Poco::Util::OptionException, Poco::Util::AmbiguousOptionException, Poco::Util::MissingOptionException, Poco::Util::MissingArgumentException, Poco::Util::InvalidArgumentException, Poco::Util::UnexpectedArgumentException, Poco::Util::IncompatibleOptionsException, Poco::Util::DuplicateOptionException, Poco::Util::EmptyOptionException, Poco::XML::DOMException, Poco::XML::EventException, Poco::XML::SAXNotSupportedException, Poco::XML::SAXException, Poco::XML::SAXNotRecognizedException, Poco::XML::SAXParseException, Poco::XML::XMLException

Member Summary

Member Functions: className, clone, displayText, message, name, nested, operator =, rethrow, what

Constructors

Exception

Exception(
    const std::string & msg
);

Creates an exception.

Exception

Exception(
    const Exception & exc
);

Copy constructor.

Exception

Exception(
    const std::string & msg,
    const std::string & arg
);

Creates an exception.

Exception

Exception(
    const std::string & msg,
    const Exception & nested
);

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

Exception protected

Exception();

Standard constructor.

Destructor

~Exception

~Exception();

Destroys the exception and deletes the nested exception.

Member Functions

className virtual

virtual const char * className() const;

Returns the name of the exception class.

clone virtual

virtual Exception * clone() const;

Creates an exact copy of the exception.

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

displayText

std::string displayText() const;

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

message inline

const std::string & message() const;

Returns the message text.

name virtual

virtual const char * name() const;

Returns a static string describing the exception.

nested inline

const Exception * nested() const;

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

operator =

Exception & operator = (
    const Exception & exc
);

Assignment operator.

rethrow virtual

virtual void rethrow() const;

(Re)Throws the exception.

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

what virtual

virtual const char * what() const;

Returns the message text as a C string.