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.
HandleCredentialError determines if given error relates to invalid credential. If it is, the credential is invalidated. Original error is returned untouched.
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.
ServiceError returns the *azure.ServiceError underlying the supplied error, if any, and a bool indicating whether one was found.
GraphError is a go error that wraps the graphrbac.GraphError response type, which doesn't implement the error interface.
AsGraphError returns a GraphError if one is contained within the given error, otherwise it returns nil.
Code returns the code from the GraphError.
Error implements the error interface.
Message returns the message from the GraphError.