зеркало из https://github.com/microsoft/moc.git
Merge pull request #145 from microsoft/users/hav/new_node_error
Added OutOfNodeCapacity Error
This commit is contained in:
Коммит
465df82aa0
|
@ -28,6 +28,7 @@ var (
|
|||
InvalidVersion error = errors.New("InvalidVersion")
|
||||
OldVersion error = errors.New("OldVersion")
|
||||
OutOfCapacity error = errors.New("OutOfCapacity")
|
||||
OutOfNodeCapacity error = errors.New("OutOfNodeCapacity")
|
||||
OutOfMemory error = errors.New("OutOfMemory")
|
||||
UpdateFailed error = errors.New("Update Failed")
|
||||
NotInitialized error = errors.New("Not Initialized")
|
||||
|
@ -79,6 +80,8 @@ func GetErrorCode(err error) string {
|
|||
return "OldVersion"
|
||||
} else if IsOutOfCapacity(err) {
|
||||
return "OutOfCapacity"
|
||||
} else if IsOutOfNodeCapacity(err) {
|
||||
return "OutOfNodeCapacity"
|
||||
} else if IsOutOfMemory(err) {
|
||||
return "OutOfMemory"
|
||||
} else if IsUpdateFailed(err) {
|
||||
|
@ -221,6 +224,9 @@ func IsOutOfRange(err error) bool {
|
|||
func IsOutOfCapacity(err error) bool {
|
||||
return checkError(err, OutOfCapacity)
|
||||
}
|
||||
func IsOutOfNodeCapacity(err error) bool {
|
||||
return checkError(err, OutOfNodeCapacity)
|
||||
}
|
||||
func IsAlreadySet(err error) bool {
|
||||
return checkError(err, AlreadySet)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче