Code:
public function beforeSave(Entity $targetList, array $options): void { try { // this is caught & rethrown in Slim\Middleware\ErrorMiddleware throw new Exception('test'); } catch (Throwable $e) { // this is never called $GLOBALS['log']->error('NEVER CAUGHT'); } }
I'm writing a module to interface with an external REST API (Mailchimp).
In some cases the API may throw an exception.
When this happens the exception is handled and passed back to the UI - my catch code is never called.
Seems to happen in any of the hook functions.
How should I handle this?
(I'm actually calling the remote API in a service class called from the hook - where I get the same behavior)
Comment