Skip to content

Commit

Permalink
chore: silence an error and log it
Browse files Browse the repository at this point in the history
  • Loading branch information
shpran committed Sep 25, 2024
1 parent e9cd24f commit 15d6c74
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion common/oatbox/event/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

use oat\oatbox\service\ConfigurableService;
use oat\oatbox\service\ServiceNotFoundException;
use Throwable;

/**
* The simple placeholder ServiceManager
Expand Down Expand Up @@ -64,7 +65,17 @@ public function trigger($event, $params = [])
}
}

call_user_func($callback, $event);
try {
call_user_func($callback, $event);
} catch (Throwable $exception) {
$this->logError(
sprintf(
'An error occurred during triggering an event callback: %s. Trace: %s',
$exception->getMessage(),
$exception->getTraceAsString()
)
);
}
}
}

Expand Down

0 comments on commit 15d6c74

Please sign in to comment.