summaryrefslogtreecommitdiff
path: root/src/callable.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:10:16 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-10 14:10:16 +0100
commit81861258bef606bcdf14d170fb73cd06e25e5ebe (patch)
tree7b9027d8d461046ee982e059da08d54f4664f4ee /src/callable.cpp
parentdd3422f6ed454d06e6091ad5023da7fc294595b8 (diff)
deal with magic methods and magic interfaces that throw exceptions
Diffstat (limited to 'src/callable.cpp')
-rw-r--r--src/callable.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/callable.cpp b/src/callable.cpp
index 66333d5..bf83e10 100644
--- a/src/callable.cpp
+++ b/src/callable.cpp
@@ -43,17 +43,10 @@ static void invoke_callable(INTERNAL_FUNCTION_PARAMETERS)
// get the result
result = callable->invoke(params);
}
- catch (Php::OrigException &exception)
+ catch (Exception &exception)
{
- // we caught an exception that was original thrown by PHP code, and not
- // processed by C++ code, this means that we're going to restore this
- // exception so that it can be further handled by PHP
- exception.restore();
- }
- catch (Php::Exception &exception)
- {
- // an exception originally thrown by C++ should be passed on to PHP
- zend_throw_exception(zend_exception_get_default(), (char*)exception.message().c_str(), 0 TSRMLS_CC);
+ // process the exception
+ exception.process();
}
}