Interface: awserr.Error

import "../ibm-cos-sdk-go/aws/awserr"

Overview

An Error wraps lower level errors with code, message and an original error. The underlying concrete error type may also satisfy other interfaces which can be to used to obtain more specific information about the error.

Calling Error() or String() will always include the full information about an error based on its underlying type.

Example:

output, err := s3manage.Upload(svc, input, opts) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Get error details log.Println("Error:", awsErr.Code(), awsErr.Message()) // Prints out full error message, including original error if there was one. log.Println("Error:", awsErr.Error()) // Get original error if origErr := awsErr.OrigErr(); origErr != nil { // operate on original error. } } else { fmt.Println(err.Error()) } }

Implemented By

kms.AlreadyExistsException, s3manager.BatchError, kms.CloudHsmClusterInUseException, kms.CloudHsmClusterInvalidConfigurationException, kms.CloudHsmClusterNotActiveException, kms.CloudHsmClusterNotFoundException, kms.CloudHsmClusterNotRelatedException, kms.CustomKeyStoreHasCMKsException, kms.CustomKeyStoreInvalidStateException, kms.CustomKeyStoreNameInUseException, kms.CustomKeyStoreNotFoundException, kms.DependencyTimeoutException, kms.DisabledException, request.ErrInvalidParams, kms.ExpiredImportTokenException, kms.IncorrectKeyException, kms.IncorrectKeyMaterialException, kms.IncorrectTrustAnchorException, kms.InternalException, kms.InvalidAliasNameException, kms.InvalidArnException, kms.InvalidCiphertextException, kms.InvalidGrantIdException, kms.InvalidGrantTokenException, kms.InvalidImportTokenException, kms.InvalidKeyUsageException, kms.InvalidMarkerException, kms.InvalidStateException, kms.KMSInvalidSignatureException, kms.KeyUnavailableException, kms.LimitExceededException, kms.MalformedPolicyDocumentException, kms.NotFoundException, session.SharedConfigAssumeRoleError, session.SharedConfigLoadError, session.SharedConfigProfileNotExistsError, kms.TagException, kms.UnsupportedOperationException

Interface Method Summary collapse

Interface Method Details

Code() string

This method is abstract.

Returns the short phrase depicting the classification of the error.



34
// File 'aws/awserr/error.go', line 34

Code() string

Message() string

This method is abstract.

Returns the error details message.



37
// File 'aws/awserr/error.go', line 37

Message() string

OrigErr() error

This method is abstract.

Returns the original error if one was set. Nil is returned if not set.



40
// File 'aws/awserr/error.go', line 40

OrigErr() error