AWS Developer Tools Blog
AWS SDK for Go Adds Error Code Constants
The AWS SDK for Go v1.6.19 release adds generated constants for all modeled service response error codes. These constants improve discoverability of the error codes that a service can return, and reduce the chance of typos that can cause errors to be handled incorrectly.
You can find the new error code constants within each of the SDK’s service client packages that are prefixed with “ErrCode”. For example, the “NoSuchBucket” error code returned by Amazon S3 API requests can be found in the s3 package as: “ErrCodeNoSuchBucket”.
Here is an example of how to use the error code constants with the Amazon S3 GetObject API response.
We’re working to include error codes for all services. Let us know if you find additional error codes to include in the AWS SDK for Go.