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: Poco::XML::XMLException, Poco::XML::XMLStreamParserException, Poco::Zip::ZipException, Poco::Zip::ZipManipulationException, Poco::XML::DOMException, Poco::XML::EventException, Poco::JWT::JWTException, Poco::JWT::ParseException, Poco::JWT::UnsupportedAlgorithmException, Poco::JWT::UnallowedAlgorithmException, Poco::JWT::SignatureException, Poco::JWT::SignatureVerificationException, Poco::JWT::SignatureGenerationException, Poco::Net::NetException, Poco::Net::InvalidAddressException, Poco::Net::InvalidSocketException, 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::Net::ICMPFragmentationException, Poco::Net::NTPException, Poco::Net::HTMLFormException, Poco::Net::WebSocketException, Poco::Net::UnsupportedFamilyException, Poco::Net::AddressFamilyMismatchException, Poco::OSP::OSPException, Poco::OSP::BundleException, Poco::OSP::ManifestException, Poco::OSP::BundleStateException, Poco::OSP::BundleVersionConflictException, Poco::OSP::BundleLoadException, Poco::OSP::BundleResolveException, Poco::OSP::BundleInstallException, Poco::OSP::BundleUninstallException, Poco::OSP::BundleSealedException, Poco::RemotingNG::RemotingException, Poco::RemotingNG::TransportException, Poco::RemotingNG::ProtocolException, Poco::RemotingNG::SecurityException, Poco::RemotingNG::AuthenticationFailedException, Poco::RemotingNG::InvalidCredentialsException, Poco::RemotingNG::NoPermissionException, Poco::RemotingNG::RemoteException, Poco::RemotingNG::SerializerException, Poco::RemotingNG::DeserializerException, Poco::RemotingNG::UnknownTransportException, Poco::RemotingNG::UnknownTypeException, Poco::RemotingNG::UnknownObjectException, Poco::RemotingNG::UnknownEventSubscriberException, Poco::RemotingNG::ORBDisabledException, Poco::RemotingNG::MissingParamException, Poco::RemotingNG::WrongReplyException, Poco::RemotingNG::UnexpectedMessageException, Poco::RemotingNG::MethodNotFoundException, Poco::Net::SSLException, Poco::Net::SSLContextException, Poco::Net::InvalidCertificateException, Poco::Net::CertificateValidationException, Poco::Net::SSLConnectionUnexpectedlyClosedException, Poco::Util::OptionException, Poco::Util::UnknownOptionException, 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::SAXException, Poco::XML::SAXNotRecognizedException, Poco::XML::SAXNotSupportedException, Poco::XML::SAXParseException, Poco::XSD::Types::XSDException, Poco::XSD::Types::TypeException, Poco::XSD::Types::SchemaException, Poco::XSD::Types::IllegalOrderException, Poco::XSD::Types::ElementException, Poco::XSD::Types::NullTypeException, Poco::XSD::Types::InvalidTypeException, Poco::XSD::Types::TypeAlreadyDefinedException, Poco::XSD::Types::NullElementException, Poco::XSD::Types::InvalidElementException, Poco::XSD::Types::ElementAlreadyDefinedException, ExistsException, TimeoutException, SystemException, RegularExpressionException, LibraryLoadException, LibraryAlreadyLoadedException, NoThreadAvailableException, PropertyNotSupportedException, PoolOverflowException, NoPermissionException, OutOfMemoryException, DataException, DataFormatException, SyntaxException, CircularReferenceException, PathSyntaxException, IOException, ProtocolException, FileException, FileExistsException, FileNotFoundException, PathNotFoundException, FileReadOnlyException, FileAccessDeniedException, CreateFileException, OpenFileException, WriteFileException, ReadFileException, DirectoryNotEmptyException, UnknownURISchemeException, TooManyURIRedirectsException, URISyntaxException, ApplicationException, BadCastException, Poco::Crypto::CryptoException, Poco::Crypto::OpenSSLException, Poco::Data::PostgreSQL::PostgreSQLException, Poco::Data::PostgreSQL::ConnectionException, Poco::Data::PostgreSQL::TransactionException, Poco::Data::PostgreSQL::StatementException, Poco::Data::LimitException, Poco::Data::NotSupportedException, Poco::Data::SessionUnavailableException, Poco::Data::SessionPoolExhaustedException, Poco::Data::SessionPoolExistsException, Poco::Data::NoDataException, Poco::Data::LengthExceededException, Poco::Data::ConnectionFailedException, Poco::Data::NotConnectedException, Poco::Data::SQLite::SQLiteException, Poco::Data::SQLite::InvalidSQLStatementException, Poco::Data::SQLite::InternalDBErrorException, Poco::Data::SQLite::DBAccessDeniedException, Poco::Data::SQLite::ExecutionAbortedException, Poco::Data::SQLite::DBLockedException, Poco::Data::SQLite::TableLockedException, Poco::Data::SQLite::NoMemoryException, Poco::Data::SQLite::ReadOnlyException, Poco::Data::SQLite::InterruptException, Poco::Data::SQLite::IOErrorException, Poco::Data::SQLite::CorruptImageException, Poco::Data::SQLite::TableNotFoundException, Poco::Data::SQLite::DatabaseFullException, Poco::Data::SQLite::CantOpenDBFileException, Poco::Data::SQLite::LockProtocolException, Poco::Data::SQLite::SchemaDiffersException, Poco::Data::SQLite::RowTooBigException, Poco::Data::SQLite::ConstraintViolationException, Poco::Data::SQLite::DataTypeMismatchException, Poco::Data::SQLite::ParameterCountMismatchException, Poco::Data::SQLite::InvalidLibraryUseException, Poco::Data::SQLite::OSFeaturesMissingException, Poco::Data::SQLite::AuthorizationDeniedException, Poco::Data::SQLite::TransactionException, LogicException, AssertionViolationException, NullPointerException, NullValueException, BugcheckException, InvalidArgumentException, NotImplementedException, RangeException, IllegalStateException, InvalidAccessException, SignalException, UnhandledException, RuntimeException, NotFoundException, Poco::Data::ODBC::ODBCException, Poco::Data::ODBC::InsufficientStorageException, Poco::Data::ODBC::UnknownDataLengthException, Poco::Data::ODBC::DataTruncatedException, Poco::Data::ODBC::HandleException, Poco::Data::DataException, Poco::Data::RowDataMissingException, Poco::Data::UnknownDataBaseException, Poco::Data::UnknownTypeException, Poco::Data::ExecutionException, Poco::Data::BindingException, Poco::Data::ExtractException, Poco::JSON::JSONTemplateException, Poco::JSON::JSONException, Poco::Data::MySQL::MySQLException, Poco::Data::MySQL::ConnectionException, Poco::Data::MySQL::TransactionException, Poco::Data::MySQL::StatementException

Member Summary

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

Constructors

Exception

Exception(
    const Exception & exc
);

Copy constructor.

Exception

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

Creates an exception.

Exception

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

Creates an exception.

Exception

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

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

Exception protected

Exception(
    int code = 0
);

Standard constructor.

Destructor

~Exception

~Exception() noexcept;

Destroys the exception and deletes the nested exception.

Member Functions

className virtual

virtual const char * className() const noexcept;

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.

code inline

int code() const;

Returns the exception code if defined.

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 noexcept;

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 noexcept;

Returns a static string describing the exception.

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

extendedMessage protected

void extendedMessage(
    const std::string & arg
);

Sets the extended message for the exception.

message protected

void message(
    const std::string & msg
);

Sets the message for the exception.