// GetS3ErrorResponseComponents returns the error fields from an S3 xml error response body.
// If an error code or message is not retrieved, it is derived from the http status code
GetS3ErrorResponseComponents returns the error fields from an S3 xml error response body.
If an error code or message is not retrieved, it is derived from the http status code
// GetS3ErrorResponseComponents returns the error fields from an S3 xml error response body . // If an error code or message is not retrieved it is derived from the http status code
func GetS3ErrorResponseComponents(r io.Reader, statusCode int) (ErrorComponents, error) {
	errComponents, err := GetErrorResponseComponents(r)
	if err != nil {
		return ErrorComponents{}, err
	}
	if len(errComponents.Code) == 0 && len(errComponents.Message) == 0 {
		statusText := http.StatusText(statusCode)
		errComponents.Code = strings.Replace(statusText, " ", "", -1)
		errComponents.Message = statusText
	}
	return errComponents, nil
}
func GetS3ErrorResponseComponents ( r io . Reader , statusCode int ) ( ErrorComponents , error ) { errComponents , err := GetErrorResponseComponents ( r ) if err != nil { return ErrorComponents { } , err } if len ( errComponents . Code ) == 0 && len ( errComponents . Message ) == 0 { statusText := http . StatusText ( statusCode ) errComponents . Code = strings . Replace ( statusText , " " , " " , - 1 ) errComponents . Message = statusText } return errComponents , nil }
GetS3ErrorResponseComponents returns the error fields from an S3 xml error response body.
GetS3ErrorResponseComponents returns the error fields from an S3 xml error response body .
// for S3 service, we derive err code and message, if none is found // derive code and message from status code