getCode() !== WP_Http::INTERNAL_SERVER_ERROR ) { return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() ); } // Anything else: log and surface a generic 500. wc_get_container() ->get( LegacyProxy::class ) ->call_function( 'wc_get_logger' ) ->error( $e->getMessage(), array( 'source' => PushNotifications::FEATURE_NAME ) ); return new WP_Error( 'woocommerce_internal_error', __( 'Internal server error', 'woocommerce' ), array( 'status' => WP_Http::INTERNAL_SERVER_ERROR ) ); } }