mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
don't throw exceptions from handle_request()
This commit is contained in:
parent
c631b64ca9
commit
8f00894080
1 changed files with 4 additions and 2 deletions
|
@ -141,7 +141,6 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
* Handles the request.
|
||||
*
|
||||
* @return bool
|
||||
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException In case a setting was not found.
|
||||
*/
|
||||
public function handle_request(): bool {
|
||||
try {
|
||||
|
@ -185,8 +184,11 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
'details' => is_a( $error, PayPalApiException::class ) ? $error->details() : array(),
|
||||
)
|
||||
);
|
||||
return false;
|
||||
} catch (\Exception $exception){
|
||||
wc_add_notice($exception->getMessage(), 'error');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue