Package: xml

import "../ibm-cos-sdk-go-v2/aws/protocol/xml"

Type Summary collapse

Function Summary collapse

Type Details

ErrorComponents struct

ErrorComponents represents the error response fields that will be deserialized from an xml error response body

Structure Fields:

Code string
Message string
RequestID string

Function Details

func GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error)

GetErrorResponseComponents returns the error fields from an xml error response body



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// File 'aws/protocol/xml/error_utils.go', line 17

func GetErrorResponseComponents(r io.Reader, noErrorWrapping bool) (ErrorComponents, error) { if noErrorWrapping { var errResponse noWrappedErrorResponse if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) } return ErrorComponents(errResponse), nil } var errResponse wrappedErrorResponse if err := xml.NewDecoder(r).Decode(&errResponse); err != nil && err != io.EOF { return ErrorComponents{}, fmt.Errorf("error while deserializing xml error response: %w", err) } return ErrorComponents(errResponse), nil }