package restjson
import "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
Index ¶
- func GetErrorInfo(decoder *json.Decoder) (errorType string, message string, err error)
- func GetSmithyGenericAPIError(decoder *json.Decoder, errorCode string) (*smithy.GenericAPIError, error)
- func SanitizeErrorCode(errorCode string) string
Functions ¶
func GetErrorInfo ¶
GetErrorInfo util looks for code, __type, and message members in the json body. These members are optionally available, and the function returns the value of member if it is available. This function is useful to identify the error code, msg in a REST JSON error response.
func GetSmithyGenericAPIError ¶
func GetSmithyGenericAPIError(decoder *json.Decoder, errorCode string) (*smithy.GenericAPIError, error)
GetSmithyGenericAPIError returns smithy generic api error and an error interface. Takes in json decoder, and error Code string as args. The function retrieves error message and error code from the decoder body. If errorCode of length greater than 0 is passed in as an argument, it is used instead.
func SanitizeErrorCode ¶
SanitizeErrorCode sanitizes the errorCode string . The rule for sanitizing is if a `:` character is present, then take only the contents before the first : character in the value. If a # character is present, then take only the contents after the first # character in the value.
Source Files ¶
- Version
- v1.16.4
- Published
- May 17, 2022
- Platform
- darwin/amd64
- Imports
- 4 packages
- Last checked
- 6 minutes ago –
Tools for package owners.