src/Exception/Builder.php
public static function parseErrorsFromResponse(HttpResponse $response)
    {
        $json = $response->getJsonResult();
        $errorStr = '';
        if (isset($json->errors)
            && is_array($json->errors)
            && !empty($json->errors)
        ) {
            foreach ($json->errors as $stdClassError) {
                if (isset($stdClassError->errors)) {
                    $errorStr .= $stdClassError->errors;
                }
                if (isset($stdClassError->product_id)) {
                    $errorStr .= sprintf('(product #%s)', $stdClassError->product_id);
                }
            }
        }

        return $errorStr;
    }
public static function parseErrorsFromResponse(HttpResponse $response)
    {
        $json = $response->getJsonResult();
        $errorStr = '';
        if (isset($json->errors)
            && is_array($json->errors)
            && !empty($json->errors)
        ) {
            foreach ($json->errors as $stdClassError) {
                if (isset($stdClassError->errors)) {
                    $errorStr .= $stdClassError->errors;
                }
                if (isset($stdClassError->product_id)) {
                    $errorStr .= sprintf('(product #%s)', $stdClassError->product_id);
                }
            }
        }

        return $errorStr;
    }
public static function parseErrorsFromResponse ( HttpResponse $ response ) { $ json = $ response -> getJsonResult ( ) ; $ errorStr = '' ; if ( isset ( $ json -> errors ) && is_array ( $ json -> errors ) && ! empty ( $ json -> errors ) ) { foreach ( $ json -> errors as $ stdClassError ) { if ( isset ( $ stdClassError -> errors ) ) { $ errorStr .= $ stdClassError -> errors ; } if ( isset ( $ stdClassError -> product_id ) ) { $ errorStr .= sprintf ( '(product #%s)' , $ stdClassError -> product_id ) ; } } } return $ errorStr ; }
Parses errors from HttpResponse
@param HttpResponse $response
@return string
Parses errors from HttpResponse