func TxAwareUnmarshalError(req *request.Request) {
	defer req.HTTPResponse.Body.Close()

	var jsonErr jsonTxErrorResponse
	err := json.NewDecoder(req.HTTPResponse.Body).Decode(&jsonErr)
	if err == io.EOF {
		req.Error = awserr.NewRequestFailure(
			awserr.New(request.ErrCodeSerialization, req.HTTPResponse.Status, nil),
			req.HTTPResponse.StatusCode,
			req.RequestID,
		)
		return
	} else if err != nil {
		req.Error = awserr.NewRequestFailure(
			awserr.New(request.ErrCodeSerialization,
				"failed decoding JSON RPC error response", err),
			req.HTTPResponse.StatusCode,
			req.RequestID,
		)
		return
	}

	codes := strings.SplitN(jsonErr.Code, "#", 2)
	req.Error = newTxRequestError(
		awserr.New(codes[len(codes)-1], jsonErr.Message, nil),
		req.HTTPResponse.StatusCode,
		req.RequestID,
		jsonErr.CancellationReasons,
	)
}
// TxAwareUnmarshalError unmarshals an error response for a JSON RPC service.
// This is exactly same as jsonrpc.UnmarshalError, except for attempt to parse CancellationReasons
TxAwareUnmarshalError unmarshals an error response for a JSON RPC service.
This is exactly same as jsonrpc.UnmarshalError, except for attempt to parse CancellationReasons
// TxAwareUnmarshalError unmarshals an error response for a JSON RPC service . // This is exactly same as jsonrpc . UnmarshalError except for attempt to parse CancellationReasons
func TxAwareUnmarshalError(req *request.Request) {
	defer req.HTTPResponse.Body.Close()
	var jsonErr jsonTxErrorResponse
	err := json.NewDecoder(req.HTTPResponse.Body).Decode(&jsonErr)
	if err == io.EOF {
		req.Error = awserr.NewRequestFailure(
			awserr.New(request.ErrCodeSerialization, req.HTTPResponse.Status, nil),
			req.HTTPResponse.StatusCode,
			req.RequestID,
		)
		return
	} else if err != nil {
		req.Error = awserr.NewRequestFailure(
			awserr.New(request.ErrCodeSerialization,
				"failed decoding JSON RPC error response", err),
			req.HTTPResponse.StatusCode,
			req.RequestID,
		)
		return
	}
	codes := strings.SplitN(jsonErr.Code, "#", 2)
	req.Error = newTxRequestError(
		awserr.New(codes[len(codes)-1], jsonErr.Message, nil),
		req.HTTPResponse.StatusCode,
		req.RequestID,
		jsonErr.CancellationReasons,
	)
}
func TxAwareUnmarshalError ( req * request . Request ) { defer req . HTTPResponse . Body . Close ( ) var jsonErr jsonTxErrorResponse err := json . NewDecoder ( req . HTTPResponse . Body ) . Decode ( & jsonErr ) if err == io . EOF { req . Error = awserr . NewRequestFailure ( awserr . New ( request . ErrCodeSerialization , req . HTTPResponse . Status , nil ) , req . HTTPResponse . StatusCode , req . RequestID , ) return } else if err != nil { req . Error = awserr . NewRequestFailure ( awserr . New ( request . ErrCodeSerialization , " " , err ) , req . HTTPResponse . StatusCode , req . RequestID , ) return } codes := strings . SplitN ( jsonErr . Code , " " , 2 ) req . Error = newTxRequestError ( awserr . New ( codes [ len ( codes ) - 1 ] , jsonErr . Message , nil ) , req . HTTPResponse . StatusCode , req . RequestID , jsonErr . CancellationReasons , ) }
TxAwareUnmarshalError unmarshals an error response for a JSON RPC service.
TxAwareUnmarshalError unmarshals an error response for a JSON RPC service .