diff --git a/sdk/ovirtsdk/error.go b/sdk/ovirtsdk/error.go index 85d6560..02fd929 100644 --- a/sdk/ovirtsdk/error.go +++ b/sdk/ovirtsdk/error.go @@ -26,6 +26,12 @@ type AuthError struct { baseError } +// Conflict error indicates that the operation failed because of a conflict. +// For example, another operation block the operation from being executed. +type ConflictError struct { + baseError +} + // NotFoundError indicates that an object can't be found. type NotFoundError struct { baseError @@ -165,6 +171,13 @@ func BuildError(response *http.Response, fault *Fault) error { buffer.String(), }, } + } else if response.StatusCode == 409 { + return &ConflictError{ + baseError{ + response.StatusCode, + buffer.String(), + }, + } } }