summaryrefslogtreecommitdiff
path: root/src/function.cpp
diff options
context:
space:
mode:
authorJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 16:50:12 +0100
committerJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 16:50:12 +0100
commitb6665b72996d23522d8a277cf4acc3d46e5e11fa (patch)
tree816b5225806f60a043e35faa366f5becf9ca2f9f /src/function.cpp
parent9185842b1d2fd352f6d71a46d2017fa25cc3c6a7 (diff)
Added a very basic exception class, and added an exception example
Diffstat (limited to 'src/function.cpp')
-rw-r--r--src/function.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/function.cpp b/src/function.cpp
index 9376751..fe96745 100644
--- a/src/function.cpp
+++ b/src/function.cpp
@@ -38,20 +38,15 @@ void invoke_function(INTERNAL_FUNCTION_PARAMETERS)
Parameters params(this_ptr, ZEND_NUM_ARGS());
// the function could throw an exception
- //try
- //{
+ try
+ {
// get the result
result = function->invoke(*PHPCPP_G(environment), params);
- //}
- //catch (const Php::Exception &exception)
- //{
- // cout << "got exception";
-
- // @todo throw the exception....
-
-
-
- //}
+ }
+ catch (const Php::Exception &exception)
+ {
+ zend_throw_exception(zend_exception_get_default(), exception.getMessage(), 0 TSRMLS_CC);
+ }
}
/**