Sha256: 254afa8f66712a6671570079a2f8f733aaa19fd80dfcfae109897b817442e0d7

Contents?: true

Size: 977 Bytes

Versions: 16

Compression:

Stored size: 977 Bytes

Contents

package http

import (
	"fmt"
	"net/http"
)

// Response provides the HTTP specific response structure for HTTP specific
// middleware steps to use to deserialize the response from an operation call.
type Response struct {
	*http.Response
}

// ResponseError provides the HTTP centric error type wrapping the underlying
// error with the HTTP response value.
type ResponseError struct {
	Response *Response
	Err      error
}

// HTTPStatusCode returns the HTTP response status code received from the service.
func (e *ResponseError) HTTPStatusCode() int { return e.Response.StatusCode }

// HTTPResponse returns the HTTP response received from the service.
func (e *ResponseError) HTTPResponse() *Response { return e.Response }

// Unwrap returns the nested error if any, or nil.
func (e *ResponseError) Unwrap() error { return e.Err }

func (e *ResponseError) Error() string {
	return fmt.Sprintf(
		"http response error StatusCode: %d, %v",
		e.Response.StatusCode, e.Err)
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/aws/smithy-go/transport/http/response.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/aws/smithy-go/transport/http/response.go