#include "OW_config.h"
#include "OW_AutoPtr.hpp"
#include <iosfwd>
#include <exception>
#include <new>
#include <cerrno>
Include dependency graph for OW_Exception.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | OW_NAMESPACE |
namespace | OW_NAMESPACE::ExceptionDetail |
Classes | |
class | OW_NAMESPACE::Exception |
This class is the base of all exceptions thrown by OpenWBEM code. More... | |
class | OW_NAMESPACE::ExceptionDetail::FormatMsg |
struct | OW_NAMESPACE::ExceptionDetail::Errno< exType > |
Defines | |
#define | OW_THROW(exType, msg) throw exType(__FILE__, __LINE__, (msg)) |
Throw an exception using __FILE__ and __LINE__. | |
#define | OW_THROWL(exType, line, msg) throw exType(__FILE__, (line), (msg)) |
This macro is deprecated in 3.1.0. | |
#define | OW_THROW_SUBEX(exType, msg, subex) |
Throw an exception using __FILE__ and __LINE__. | |
#define | OW_THROW_ERR(exType, msg, err) throw exType(__FILE__, __LINE__, (msg), (err)) |
Throw an exception using __FILE__ and __LINE__. | |
#define | OW_THROW_ERRNO(exType) OW_THROW_ERRNO1(exType, errno) |
Throw an exception using __FILE__, __LINE__, errno and strerror(errno). | |
#define | OW_THROW_ERRNO1(exType, errnum) throw ExceptionDetail::Errno< exType >::simple(__FILE__, __LINE__, (errnum)) |
Throw an exception using __FILE__, __LINE__, errnum and strerror(errnum). | |
#define | OW_THROW_ERRNO_MSG(exType, msg) OW_THROW_ERRNO_MSG1(exType, (msg), errno) |
Throw an exception using __FILE__, __LINE__, errno and strerror(errno). | |
#define | OW_THROW_ERRNO_MSG1(exType, msg, errnum) |
Throw an exception using __FILE__, __LINE__, errnum and strerror(errnum). | |
#define | OW_THROW_ERR_SUBEX(exType, msg, err, subex) throw exType(__FILE__, __LINE__, (msg), (err), &(subex)) |
Throw an exception using __FILE__ and __LINE__. | |
#define | OW_DECLARE_EXCEPTION2(NAME, BASE) |
Declare a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | OW_DECLARE_APIEXCEPTION2(NAME, BASE, LINKAGE_SPEC) |
Declare a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | OW_DECLARE_EXCEPTION(NAME) OW_DECLARE_EXCEPTION2(NAME, ::OW_NAMESPACE::Exception) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file. | |
#define | OW_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC) OW_DECLARE_APIEXCEPTION2(NAME, ::OW_NAMESPACE::Exception, LINKAGE_SPEC) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file. | |
#define | OW_DEFINE_EXCEPTION2(NAME, BASE) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | OW_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX(NAME, BASE, SUB_CLASS_ID) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | OW_DEFINE_EXCEPTION(NAME) OW_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX(NAME, ::OW_NAMESPACE::Exception, ::OW_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID) |
Define a new exception class named <NAME>Exception that derives from Exception. | |
#define | OW_DEFINE_EXCEPTION_WITH_ID(NAME) OW_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX(NAME, ::OW_NAMESPACE::Exception, ::OW_NAMESPACE::ExceptionIds::NAME##ExceptionId) |
Define a new exception class named <NAME>Exception that derives from Exception. | |
#define | OW_DEFINE_EXCEPTION_WITH_BASE_AND_ID(NAME, BASE) OW_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX(NAME, BASE, ::OW_NAMESPACE::ExceptionIds::NAME##ExceptionId) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
Functions | |
void | OW_NAMESPACE::ExceptionDetail::portable_strerror_r (int errnum, char *buf, unsigned n) |
std::ostream & | OW_NAMESPACE::operator<< (std::ostream &os, const Exception &e) |
Writes the exception object to the stream in the form: <file>: <line> <type>: <message>. | |
Variables | |
unsigned const | OW_NAMESPACE::ExceptionDetail::BUFSZ = 1024 |
|
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file.
Definition at line 381 of file OW_Exception.hpp. |
|
Value: class LINKAGE_SPEC NAME##Exception : public BASE \ { \ public: \ NAME##Exception(const char* file, int line, const char* msg, int errorCode = ::OW_NAMESPACE::Exception::UNKNOWN_ERROR_CODE, const Exception* otherException = 0, int subClassId = ::OW_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID); \ virtual ~NAME##Exception() throw(); \ virtual const char* type() const; \ virtual NAME##Exception* clone() const; \ }; This macro is typically used in a header file. The exception class declaration will be prefaced with the linkage_spec parm. This allows the use of OW_COMMON_API when declaring exceptions. Example: OW_DECLARE_APIEXCEPTION(Bogus, CIMException, OW_COMMON_API)
Definition at line 352 of file OW_Exception.hpp. |
|
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file.
Definition at line 371 of file OW_Exception.hpp. |
|
Value: class NAME##Exception : public BASE \ { \ public: \ NAME##Exception(const char* file, int line, const char* msg, int errorCode = ::OW_NAMESPACE::Exception::UNKNOWN_ERROR_CODE, const Exception* otherException = 0, int subClassId = ::OW_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID); \ virtual ~NAME##Exception() throw(); \ virtual const char* type() const; \ virtual NAME##Exception* clone() const; \ }; This macro is typically used in a header file.
Definition at line 331 of file OW_Exception.hpp. |
|
Define a new exception class named <NAME>Exception that derives from Exception. The new class will use UNKNOWN_SUBCLASS_ID for the subclass id. Use this macro for internal implementation exceptions that don't have an id. This macro is typically used in a cpp file.
Definition at line 422 of file OW_Exception.hpp. |
|
Value: NAME##Exception::NAME##Exception(const char* file, int line, const char* msg, int errorCode, const ::OW_NAMESPACE::Exception* otherException, int subClassId) \ : BASE(file, line, msg, errorCode, otherException, subClassId) {} \ NAME##Exception::~NAME##Exception() throw() { } \ NAME##Exception* NAME##Exception::clone() const { return new(std::nothrow) NAME##Exception(*this); } \ const char* NAME##Exception::type() const { return #NAME "Exception"; } The new class will use UNKNOWN_SUBCLASS_ID for the subclass id. This macro is typically used in a cpp file.
Definition at line 391 of file OW_Exception.hpp. |
|
Define a new exception class named <NAME>Exception that derives from <BASE>. The new class will use ExceptionIds::<NAME>ExceptionId for the subclass id. Use this macro to create public exceptions that have an id in the OW_NAMESPACE::ExceptionIds namespace that will derive from BASE This macro is typically used in a cpp file.
Definition at line 443 of file OW_Exception.hpp. |
|
Value: NAME##Exception::NAME##Exception(const char* file, int line, const char* msg, int errorCode, const ::OW_NAMESPACE::Exception* otherException, int subClassId) \ : BASE(file, line, msg, errorCode, otherException, subClassId == ::OW_NAMESPACE::Exception::UNKNOWN_SUBCLASS_ID ? (SUB_CLASS_ID) : subClassId) {} \ NAME##Exception::~NAME##Exception() throw() { } \ NAME##Exception* NAME##Exception::clone() const { return new(std::nothrow) NAME##Exception(*this); } \ const char* NAME##Exception::type() const { return #NAME "Exception"; } The new class will use SUB_CLASS_ID for the subclass id. This macro is typically used in a cpp file.
Definition at line 407 of file OW_Exception.hpp. |
|
Define a new exception class named <NAME>Exception that derives from Exception. The new class will use ExceptionIds::<NAME>ExceptionId for the subclass id. Use this macro to create public exceptions that have an id in the OW_NAMESPACE::ExceptionIds namespace that derive from Exception This macro is typically used in a cpp file.
Definition at line 432 of file OW_Exception.hpp. |
|
|
Throw an exception using __FILE__ and __LINE__.
Definition at line 278 of file OW_Exception.hpp. Referenced by OW_NAMESPACE::dbUtils::checkReturn(), OW_NAMESPACE::CmdLineParser::CmdLineParser(), OW_NAMESPACE::fillDateTimeData(), OW_NAMESPACE::CIMInstance::getPropertyT(), OW_NAMESPACE::CIMBase::readSig(), and strend_checked(). |
|
Throw an exception using __FILE__ and __LINE__.
Definition at line 321 of file OW_Exception.hpp. |
|
Throw an exception using __FILE__, __LINE__, errno and strerror(errno).
Definition at line 286 of file OW_Exception.hpp. Referenced by OW_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory(), and OW_NAMESPACE::FileSystem::readSymbolicLink(). |
|
Throw an exception using __FILE__, __LINE__, errnum and strerror(errnum).
Definition at line 293 of file OW_Exception.hpp. |
|
Throw an exception using __FILE__, __LINE__, errno and strerror(errno).
Definition at line 301 of file OW_Exception.hpp. Referenced by OW_NAMESPACE::AssocDb::addEntry(), OW_NAMESPACE::AssocDb::addToFreeList(), OW_NAMESPACE::AssocDb::checkFile(), OW_NAMESPACE::ServerSocketImpl::close(), OW_NAMESPACE::SocketBaseImpl::connect(), OW_NAMESPACE::LocalAuthenticationCommon::createFile(), OW_NAMESPACE::AssocDb::createFile(), OW_NAMESPACE::Platform::daemonize(), OW_NAMESPACE::ServerSocketImpl::doListen(), OW_NAMESPACE::ServerSocketImpl::fillAddrParms(), OW_NAMESPACE::SocketBaseImpl::fillUnixAddrParms(), OW_NAMESPACE::AssocDb::getHandle(), OW_NAMESPACE::AssocDb::getNewBlock(), OW_NAMESPACE::HTTPXMLCIMListener::HTTPXMLCIMListener(), OW_NAMESPACE::LocalAuthenticationCommon::initializeDir(), OW_NAMESPACE::killWait(), OW_NAMESPACE::TmpFileImpl::open(), OW_NAMESPACE::SocketBaseImpl::read(), OW_NAMESPACE::PosixUnnamedPipe::read(), OW_NAMESPACE::HDBNode::read(), OW_NAMESPACE::BinarySerialization::read(), OW_NAMESPACE::AssocDb::readEntry(), OW_NAMESPACE::readRecHeader(), OW_NAMESPACE::TmpFileImpl::releaseFile(), OW_NAMESPACE::HDBNode::removeBlock(), OW_NAMESPACE::Platform::rerunDaemon(), OW_NAMESPACE::Exec::safePopen(), OW_NAMESPACE::HTTPClient::sendAuthorization(), OW_NAMESPACE::PosixUnnamedPipe::setBlocking(), OW_NAMESPACE::PosixUnnamedPipe::setOutputBlocking(), OW_NAMESPACE::HTTPServer::shutdown(), OW_NAMESPACE::Socket::shutdownAllSockets(), OW_NAMESPACE::timedWaitPid(), OW_NAMESPACE::SocketBaseImpl::write(), OW_NAMESPACE::PosixUnnamedPipe::write(), OW_NAMESPACE::HDBNode::write(), OW_NAMESPACE::BinarySerialization::write(), and OW_NAMESPACE::writeRecHeader(). |
|
Value: throw ExceptionDetail::Errno< exType >:: \
format(__FILE__, __LINE__, (msg), (errnum))
Definition at line 309 of file OW_Exception.hpp. |
|
Value: throw exType(__FILE__, __LINE__, (msg), \ ::OW_NAMESPACE::Exception::UNKNOWN_ERROR_CODE, &(subex))
Definition at line 268 of file OW_Exception.hpp. |
|
This macro is deprecated in 3.1.0.
Definition at line 259 of file OW_Exception.hpp. |