diff options
author | Martijn Otto <martijn.otto@copernica.com> | 2016-05-20 13:38:56 +0200 |
---|---|---|
committer | Martijn Otto <martijn.otto@copernica.com> | 2016-05-20 13:38:56 +0200 |
commit | 252870d4a85f942107e7b51f9bdf5fae4e88f728 (patch) | |
tree | 0b4d9108c0f75bcbe6a9a8a5ba51bb73eeb6a28a /zend/origexception.h | |
parent | 8308b984cc61cb2464b9192961abaae4fe750591 (diff) |
Fix exception catching and properly handle casting functions returning something other than a Php::Value
Diffstat (limited to 'zend/origexception.h')
-rw-r--r-- | zend/origexception.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/zend/origexception.h b/zend/origexception.h index f997608..fb873bd 100644 --- a/zend/origexception.h +++ b/zend/origexception.h @@ -16,7 +16,7 @@ namespace Php { /** * Class definition */ -class OrigException : public Value, public Exception +class OrigException : public Exception { private: /** @@ -42,10 +42,9 @@ private: public: /** * Constructor - * @param val + * @param object The object that was thrown */ - OrigException(zval *val TSRMLS_DC) : - Value(val), Exception("OrigException") + OrigException(zend_object *object) : Exception(std::string{ ZSTR_VAL(object->ce->name), ZSTR_LEN(object->ce->name) }) { #ifdef ZTS // copy tsrm_ls @@ -58,7 +57,7 @@ public: * @param exception */ OrigException(const OrigException &exception) : - Value(exception), Exception("OrigException"), _handled(exception._handled) + Exception("OrigException"), _handled(exception._handled) { #ifdef ZTS // copy tsrm_ls @@ -71,7 +70,7 @@ public: * @param exception */ OrigException(OrigException &&exception) : - Value(std::move(exception)), Exception("OrigException"), _handled(exception._handled) + Exception("OrigException"), _handled(exception._handled) { // set other exception to handled so that it wont do anything on destruction exception._handled = true; |