add a new type of error and check for RequestErrors that are not pointers
@@ -15,6 +15,7 @@ const (
ResourceNotFound = "ResourceNotFound"
AsyncOpIncompleteError = "AsyncOpIncomplete"
InvalidServerName = "InvalidServerName"
+ RequestConflictError = "Conflict"
)
func NewAzureError(err error) error {
@@ -32,6 +33,9 @@ func NewAzureError(err error) error {
if e, ok := det.Original.(*azure.RequestError); ok {
kind = e.ServiceError.Code
reason = e.ServiceError.Message
+ } else if e, ok := det.Original.(azure.RequestError); ok {
+ kind = e.ServiceError.Code
+ reason = e.ServiceError.Message
} else if e, ok := det.Original.(*azure.ServiceError); ok {
kind = e.Code
reason = e.Message
