You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( false === strpos( $content_type, 'application/json' ) ) {
375
-
if ( 200 != $response_code ) {
376
-
returnnewWP_Error(
377
-
'wcc_server_error',
378
-
sprintf( 'Error: The WooCommerce Services server returned HTTP code: %d', $response_code )
379
-
);
375
+
if ( ! $response_code ) {
376
+
returnnewWP_Error( 'wcc_server_error', 'The WooCommerce Services API could not be reached. Please make sure your server can make requests to api.woocommerce.com, and try again.' );
377
+
} elseif ( 500 == $response_code ) {
378
+
returnnewWP_Error( 'wcc_server_error', 'The WooCommerce Services API encountered an error. Please try again.' );
379
+
} elseif ( 200 != $response_code ) {
380
+
returnnewWP_Error( 'wcc_server_error', sprintf( 'The WooCommerce Services API returned HTTP status code: %d', $response_code ) );
0 commit comments