summaryrefslogtreecommitdiff
path: root/include/exception.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:18:45 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-06 21:18:45 +0200
commitda4710512865e6816585ac4ab8edab2fa125e2d8 (patch)
tree2d2ad42235032db4160231d221babd6cb91f6371 /include/exception.h
parente8b7f9a5f80c0f296d05403a84a5259cb48f9329 (diff)
the exception.h header file no longer depends on the zend engine header files. TSRM macros are no longer used in any of the public PHPCPP header files so there is no more need for the phpcpp/config.h header file nor the config-create script
Diffstat (limited to 'include/exception.h')
-rw-r--r--include/exception.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/include/exception.h b/include/exception.h
index dd38035..671df9e 100644
--- a/include/exception.h
+++ b/include/exception.h
@@ -30,42 +30,51 @@ private:
*/
int _code;
+ /**
+ * Has this exception been processed by native C++ code?
+ * @var bool
+ */
+ bool _processed = false;
+
public:
/**
* Constructor
* @param &string
*/
- Exception(const std::string &message, int code = 0) : std::exception(), _message(message), _code(code)
- {
- }
+ Exception(const std::string &message, int code = 0) : std::exception(), _message(message), _code(code) {}
/**
* Destructor
*/
- virtual ~Exception() throw()
+ virtual ~Exception() throw() {}
+
+ /**
+ * Overridden what method
+ * @return const char *
+ */
+ virtual const char *what() const noexcept override
{
+ return _message.c_str();
}
/**
* Returns the message of the exception.
* @return &string
*/
- std::string &message() throw()
+ const std::string &message() const throw()
{
return _message;
}
/**
- * Process the exception
- *
- * This method is called only from within the PHP-CPP library,
- * and will turn the exception into a PHP exception
- *
- * @param tsrm_ls
- *
- * @internal
+ * Is this a native exception (one that was thrown from C++ code)
+ * @return bool
*/
- virtual void process(TSRMLS_D);
+ virtual bool native() const
+ {
+ // yes, it is native
+ return true;
+ }
};
/**