mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 04:59:07 +08:00
Merge pull request #187 from woocommerce/PCP-179-incorrect-api-credentials-cause-
Incorrect API credentials cause fatal error
This commit is contained in:
commit
2efb300be8
4 changed files with 45 additions and 17 deletions
|
@ -120,7 +120,11 @@ class PayPalBearer implements Bearer {
|
|||
|
||||
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
|
||||
$error = new RuntimeException(
|
||||
__( 'Could not create token.', 'woocommerce-paypal-payments' )
|
||||
sprintf(
|
||||
// translators: %s is the error description.
|
||||
__( 'Could not create token. %s', 'woocommerce-paypal-payments' ),
|
||||
isset( json_decode( $response['body'] )->error_description ) ? json_decode( $response['body'] )->error_description : ''
|
||||
)
|
||||
);
|
||||
$this->logger->log(
|
||||
'warning',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue