* slots and emitting signals.
*/
class OC_Hook{
+ public static $thrownExceptions = [];
+
static private $registered = array();
/**
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);
});
}
+ protected function tearDown() {
+ $hookExceptions = \OC_Hook::$thrownExceptions;
+ \OC_Hook::$thrownExceptions = [];
+ if(!empty($hookExceptions)) {
+ throw $hookExceptions[0];
+ }
+ }
+
/**
* Returns a unique identifier as uniqid() is not reliable sometimes
*