don't throw exceptions from handle_request()

This commit is contained in:
Kirill Braslavsky 2021-03-16 12:02:02 +02:00
parent c631b64ca9
commit 8f00894080

View file

@ -141,7 +141,6 @@ class CreateOrderEndpoint implements EndpointInterface {
* Handles the request. * Handles the request.
* *
* @return bool * @return bool
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException In case a setting was not found.
*/ */
public function handle_request(): bool { public function handle_request(): bool {
try { try {
@ -185,8 +184,11 @@ class CreateOrderEndpoint implements EndpointInterface {
'details' => is_a( $error, PayPalApiException::class ) ? $error->details() : array(), 'details' => is_a( $error, PayPalApiException::class ) ? $error->details() : array(),
) )
); );
return false; } catch (\Exception $exception){
wc_add_notice($exception->getMessage(), 'error');
} }
return false;
} }
/** /**