Documentation ¶
Index ¶
- func CheckForDetailedError(r autorest.Responder) autorest.Responder
- func CheckForGraphError(r autorest.Responder) autorest.Responder
- func HandleCredentialError(err error, ctx context.ProviderCallContext) error
- func MaybeInvalidateCredential(err error, ctx context.ProviderCallContext) bool
- func ServiceError(err error) (*azure.ServiceError, bool)
- type GraphError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForDetailedError ¶
CheckForDetailedError attempts to unmarshal the body into a DetailedError. If this succeeds then the DetailedError is returned as an error, otherwise the response is passed on to the next Responder.
func CheckForGraphError ¶
CheckForGraphError attempts to unmarshal the body into a GraphError. If this succeeds then the GraphError is returned as an error, otherwise the response is passed on to the next Responder.
func HandleCredentialError ¶
func HandleCredentialError(err error, ctx context.ProviderCallContext) error
HandleCredentialError determines if given error relates to invalid credential. If it is, the credential is invalidated. Original error is returned untouched.
func MaybeInvalidateCredential ¶
func MaybeInvalidateCredential(err error, ctx context.ProviderCallContext) bool
MaybeInvalidateCredential determines if given error is related to authentication/authorisation failures. If an error is related to an invalid credential, then this call will try to invalidate that credential as well.
func ServiceError ¶
func ServiceError(err error) (*azure.ServiceError, bool)
ServiceError returns the *azure.ServiceError underlying the supplied error, if any, and a bool indicating whether one was found.
Types ¶
type GraphError ¶
type GraphError struct {
graphrbac.GraphError
}
GraphError is a go error that wraps the graphrbac.GraphError response type, which doesn't implement the error interface.
func AsGraphError ¶
func AsGraphError(err error) *GraphError
AsGraphError returns a GraphError if one is contained within the given error, otherwise it returns nil.
func (*GraphError) Code ¶
func (e *GraphError) Code() string
Code returns the code from the GraphError.
func (*GraphError) Error ¶
func (e *GraphError) Error() string
Error implements the error interface.
func (*GraphError) Message ¶
func (e *GraphError) Message() string
Message returns the message from the GraphError.