From a1f3cb4a49d18d680332059664bb4fd3cb2f512c Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 30 Sep 2021 09:14:48 +0300 Subject: [PATCH] Add status code in unknown PayPalApiException message --- .../src/Exception/class-paypalapiexception.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-api-client/src/Exception/class-paypalapiexception.php b/modules/ppcp-api-client/src/Exception/class-paypalapiexception.php index d5da7357e..6f227d001 100644 --- a/modules/ppcp-api-client/src/Exception/class-paypalapiexception.php +++ b/modules/ppcp-api-client/src/Exception/class-paypalapiexception.php @@ -39,9 +39,13 @@ class PayPalApiException extends RuntimeException { $response = new \stdClass(); } if ( ! isset( $response->message ) ) { - $response->message = __( - 'Unknown error while connecting to PayPal.', - 'woocommerce-paypal-payments' + $response->message = sprintf( + /* translators: %1$d - HTTP status code number (404, 500, ...) */ + __( + 'Unknown error while connecting to PayPal. Status code: %1$d.', + 'woocommerce-paypal-payments' + ), + $this->status_code ); } if ( ! isset( $response->name ) ) {