summaryrefslogtreecommitdiffstats
path: root/lib/private/hook.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-24 10:19:30 +0100
committerRobin Appelman <icewind@owncloud.com>2015-03-26 17:07:02 +0100
commitddd6a67d2a36791e2f921596f6c34436c4d5752d (patch)
tree6a69dae39021f89c0216612423dd94b2337eb8e8 /lib/private/hook.php
parent3ed6ed3c3674bfc60bcd2fc64edea1820f1be9d0 (diff)
downloadnextcloud-server-ddd6a67d2a36791e2f921596f6c34436c4d5752d.tar.gz
nextcloud-server-ddd6a67d2a36791e2f921596f6c34436c4d5752d.zip
Handle exceptions thrown during hooks when running unit tests
Diffstat (limited to 'lib/private/hook.php')
-rw-r--r--lib/private/hook.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/hook.php b/lib/private/hook.php
index 00fb4cb0ff5..c4997eeceff 100644
--- a/lib/private/hook.php
+++ b/lib/private/hook.php
@@ -5,6 +5,8 @@
* slots and emitting signals.
*/
class OC_Hook{
+ public static $thrownExceptions = [];
+
static private $registered = array();
/**
@@ -77,6 +79,7 @@ class OC_Hook{
try {
call_user_func( array( $i["class"], $i["name"] ), $params );
} catch (Exception $e){
+ self::$thrownExceptions[] = $e;
OC_Log::write('hook',
'error while running hook (' . $i["class"] . '::' . $i["name"] . '): '.$e->getMessage(),
OC_Log::ERROR);