Struct: http.ResponseError

import "../ibm-cos-sdk-go-v2/aws/transport/http"

Overview

ResponseError provides the HTTP centric error type wrapping the underlying error with the HTTP response value and the deserialized RequestID.

Implemented Interfaces

types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, types.MetricsFilter, s3.PresignPost, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream

Structure Field Summary collapse

Method Summary collapse

Structure Field Details

RequestID string

RequestID associated with response error

Method Details

func (e *ResponseError) As(target interface{}) bool

As populates target and returns true if the type of target is a error type that the ResponseError embeds, (e.g.AWS HTTP ResponseError)



30
31
32
// File 'aws/transport/http/response_error.go', line 30

func (e *ResponseError) As(target interface{}) bool { return errors.As(e.ResponseError, target) }

func (e *ResponseError) ServiceRequestID() string { return e.RequestID }

ServiceRequestID returns the request id associated with Response Error



19
20
21
22
23
24
25
26
// File 'aws/transport/http/response_error.go', line 19

func (e *ResponseError) ServiceRequestID() string { return e.RequestID } // Error returns the formatted error func (e *ResponseError) Error() string { return fmt.Sprintf( "https response error StatusCode: %d, RequestID: %s, %v", e.Response.StatusCode, e.RequestID, e.Err) }