activemq-cpp-3.4.0
|
#include <src/main/decaf/lang/Exception.h>
Public Member Functions | |
Exception () throw () | |
Default Constructor. | |
Exception (const Exception &ex) throw () | |
Copy Constructor. | |
Exception (const std::exception *cause) throw () | |
Constructor. | |
Exception (const char *file, const int lineNumber, const char *msg,...) throw () | |
Constructor - Initializes the file name and line number where this message occurred. | |
Exception (const char *file, const int lineNumber, const std::exception *cause, const char *msg,...) throw () | |
Constructor - Initializes the file name and line number where this message occurred. | |
virtual | ~Exception () throw () |
virtual std::string | getMessage () const |
Gets the message for this exception. | |
virtual const std::exception * | getCause () const |
Gets the exception that caused this one to be thrown, this allows for chaining of exceptions in the case of a method that throws only a particular exception but wishes to allow for the real causal exception to be passed only in case the caller knows about that type of exception and wishes to respond to it. | |
virtual void | initCause (const std::exception *cause) |
Initializes the contained cause exception with the one given. | |
virtual const char * | what () const throw () |
Implement method from std::exception. | |
virtual void | setMessage (const char *msg,...) |
Sets the cause for this exception. | |
virtual void | setMark (const char *file, const int lineNumber) |
Adds a file/line number to the stack trace. | |
virtual Exception * | clone () const |
Clones this exception. | |
virtual std::vector< std::pair < std::string, int > > | getStackTrace () const |
Provides the stack trace for every point where this exception was caught, marked, and rethrown. | |
virtual void | printStackTrace () const |
Prints the stack trace to std::err. | |
virtual void | printStackTrace (std::ostream &stream) const |
Prints the stack trace to the given output stream. | |
virtual std::string | getStackTraceString () const |
Gets the stack trace as one contiguous string. | |
Exception & | operator= (const Exception &ex) |
Assignment operator. | |
Protected Member Functions | |
virtual void | setStackTrace (const std::vector< std::pair< std::string, int > > &trace) |
virtual void | buildMessage (const char *format, va_list &vargs) |
Protected Attributes | |
std::string | message |
The cause of this exception. | |
std::exception * | cause |
The Exception that caused this one to be thrown. | |
std::vector< std::pair < std::string, int > > | stackTrace |
The stack trace. |
decaf::lang::Exception::Exception | ( | ) | throw () |
Default Constructor.
decaf::lang::Exception::Exception | ( | const Exception & | ex | ) | throw () |
Copy Constructor.
ex | The Exception instance to copy. |
decaf::lang::Exception::Exception | ( | const std::exception * | cause | ) | throw () |
Constructor.
cause | Pointer to the exception that caused this one to be thrown, the object is cloned caller retains ownership. |
decaf::lang::Exception::Exception | ( | const char * | file, |
const int | lineNumber, | ||
const char * | msg, | ||
... | |||
) | throw () |
Constructor - Initializes the file name and line number where this message occurred.
Sets the message to report, using an optional list of arguments to parse into the message
file | The file name where exception occurs |
lineNumber | The line number where the exception occurred. |
msg | The message to report |
... | list of primitives that are formatted into the message |
decaf::lang::Exception::Exception | ( | const char * | file, |
const int | lineNumber, | ||
const std::exception * | cause, | ||
const char * | msg, | ||
... | |||
) | throw () |
Constructor - Initializes the file name and line number where this message occurred.
Sets the message to report, using an optional list of arguments to parse into the message
file | The file name where exception occurs |
lineNumber | The line number where the exception occurred. |
cause | The exception that was the cause for this one to be thrown. |
msg | The message to report |
... | list of primitives that are formatted into the message |
virtual decaf::lang::Exception::~Exception | ( | ) | throw () [virtual] |
virtual void decaf::lang::Exception::buildMessage | ( | const char * | format, |
va_list & | vargs | ||
) | [protected, virtual] |
virtual Exception* decaf::lang::Exception::clone | ( | ) | const [virtual] |
Clones this exception.
This is useful for cases where you need to preserve the type of the original exception as well as the message. All subclasses should override.
Implements decaf::lang::Throwable.
Reimplemented in activemq::exceptions::ActiveMQException, activemq::exceptions::BrokerException, activemq::exceptions::ConnectionFailedException, decaf::internal::net::ssl::openssl::OpenSSLSocketException, decaf::io::EOFException, decaf::io::InterruptedIOException, decaf::io::IOException, decaf::io::UnsupportedEncodingException, decaf::io::UTFDataFormatException, decaf::lang::exceptions::ClassCastException, decaf::lang::exceptions::IllegalArgumentException, decaf::lang::exceptions::IllegalMonitorStateException, decaf::lang::exceptions::IllegalStateException, decaf::lang::exceptions::IllegalThreadStateException, decaf::lang::exceptions::IndexOutOfBoundsException, decaf::lang::exceptions::InterruptedException, decaf::lang::exceptions::InvalidStateException, decaf::lang::exceptions::NullPointerException, decaf::lang::exceptions::NumberFormatException, decaf::lang::exceptions::RuntimeException, decaf::lang::exceptions::UnsupportedOperationException, decaf::net::BindException, decaf::net::ConnectException, decaf::net::HttpRetryException, decaf::net::MalformedURLException, decaf::net::NoRouteToHostException, decaf::net::PortUnreachableException, decaf::net::ProtocolException, decaf::net::SocketException, decaf::net::SocketTimeoutException, decaf::net::UnknownHostException, decaf::net::UnknownServiceException, decaf::net::URISyntaxException, decaf::nio::BufferOverflowException, decaf::nio::BufferUnderflowException, decaf::nio::InvalidMarkException, decaf::nio::ReadOnlyBufferException, decaf::security::cert::CertificateEncodingException, decaf::security::cert::CertificateException, decaf::security::cert::CertificateExpiredException, decaf::security::cert::CertificateNotYetValidException, decaf::security::cert::CertificateParsingException, decaf::security::GeneralSecurityException, decaf::security::InvalidKeyException, decaf::security::KeyException, decaf::security::KeyManagementException, decaf::security::NoSuchAlgorithmException, decaf::security::NoSuchProviderException, decaf::security::SignatureException, decaf::util::concurrent::BrokenBarrierException, decaf::util::concurrent::CancellationException, decaf::util::concurrent::ExecutionException, decaf::util::concurrent::RejectedExecutionException, decaf::util::concurrent::TimeoutException, decaf::util::ConcurrentModificationException, decaf::util::NoSuchElementException, decaf::util::zip::DataFormatException, and decaf::util::zip::ZipException.
virtual const std::exception* decaf::lang::Exception::getCause | ( | ) | const [inline, virtual] |
Gets the exception that caused this one to be thrown, this allows for chaining of exceptions in the case of a method that throws only a particular exception but wishes to allow for the real causal exception to be passed only in case the caller knows about that type of exception and wishes to respond to it.
Implements decaf::lang::Throwable.
virtual std::string decaf::lang::Exception::getMessage | ( | ) | const [inline, virtual] |
Gets the message for this exception.
Implements decaf::lang::Throwable.
Referenced by activemq::exceptions::BrokerException::BrokerException().
virtual std::vector< std::pair< std::string, int> > decaf::lang::Exception::getStackTrace | ( | ) | const [virtual] |
Provides the stack trace for every point where this exception was caught, marked, and rethrown.
The first item in the returned vector is the first point where the mark was set (e.g. where the exception was created).
Implements decaf::lang::Throwable.
virtual std::string decaf::lang::Exception::getStackTraceString | ( | ) | const [virtual] |
Gets the stack trace as one contiguous string.
Implements decaf::lang::Throwable.
virtual void decaf::lang::Exception::initCause | ( | const std::exception * | cause | ) | [virtual] |
Initializes the contained cause exception with the one given.
A copy is made to avoid ownership issues.
cause | The exception that was the cause of this one. |
Implements decaf::lang::Throwable.
Assignment operator.
ex | const reference to another Exception |
virtual void decaf::lang::Exception::printStackTrace | ( | ) | const [virtual] |
Prints the stack trace to std::err.
Implements decaf::lang::Throwable.
virtual void decaf::lang::Exception::printStackTrace | ( | std::ostream & | stream | ) | const [virtual] |
Prints the stack trace to the given output stream.
stream | the target output stream. |
Implements decaf::lang::Throwable.
virtual void decaf::lang::Exception::setMark | ( | const char * | file, |
const int | lineNumber | ||
) | [virtual] |
Adds a file/line number to the stack trace.
file | The name of the file calling this method (use __FILE__). |
lineNumber | The line number in the calling file (use __LINE__). |
Implements decaf::lang::Throwable.
Referenced by decaf::lang::exceptions::NumberFormatException::NumberFormatException().
virtual void decaf::lang::Exception::setMessage | ( | const char * | msg, |
... | |||
) | [virtual] |
Sets the cause for this exception.
msg | the format string for the msg. |
... | params to format into the string |
virtual void decaf::lang::Exception::setStackTrace | ( | const std::vector< std::pair< std::string, int > > & | trace | ) | [protected, virtual] |
virtual const char* decaf::lang::Exception::what | ( | ) | const throw () [inline, virtual] |
Implement method from std::exception.
getMessage()
. std::exception* decaf::lang::Exception::cause [protected] |
The Exception that caused this one to be thrown.
std::string decaf::lang::Exception::message [protected] |
The cause of this exception.
std::vector< std::pair< std::string, int> > decaf::lang::Exception::stackTrace [protected] |
The stack trace.