Skip to content

Commit

Permalink
refs #48596 logging an error during registering a hook
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan202 committed Dec 13, 2024
1 parent 532d0bf commit a47a012
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2929,6 +2929,27 @@ public function registerHooks()
return $result;
}

public function registerHook($hook_name, $shop_list = null)
{
try {
return parent::registerHook($hook_name, $shop_list);
} catch (Throwable $e) {
} catch (Exception $e) {
}

ProcessLoggerHandler::openLogger();
ProcessLoggerHandler::logError(
sprintf(
'Error during registering the hook %s: %s',
$hook_name,
$e->getMessage()
)
);
ProcessLoggerHandler::closeLogger();

return false;
}

/**
* @param PaypalOrder $paypalOrder
*
Expand Down

0 comments on commit a47a012

Please sign in to comment.