2023-08-29 11:56:55 +00:00
|
|
|
package errdefs
|
2017-07-19 14:20:13 +00:00
|
|
|
|
|
|
|
// ErrNotFound signals that the requested object doesn't exist
|
|
|
|
type ErrNotFound interface {
|
|
|
|
NotFound()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrInvalidParameter signals that the user input is invalid
|
|
|
|
type ErrInvalidParameter interface {
|
|
|
|
InvalidParameter()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrConflict signals that some internal state conflicts with the requested action and can't be performed.
|
|
|
|
// A change in state should be able to clear this error.
|
|
|
|
type ErrConflict interface {
|
|
|
|
Conflict()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrUnauthorized is used to signify that the user is not authorized to perform a specific action
|
|
|
|
type ErrUnauthorized interface {
|
|
|
|
Unauthorized()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrUnavailable signals that the requested action/subsystem is not available.
|
|
|
|
type ErrUnavailable interface {
|
|
|
|
Unavailable()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrForbidden signals that the requested action cannot be performed under any circumstances.
|
|
|
|
// When a ErrForbidden is returned, the caller should never retry the action.
|
|
|
|
type ErrForbidden interface {
|
|
|
|
Forbidden()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrSystem signals that some internal error occurred.
|
|
|
|
// An example of this would be a failed mount request.
|
|
|
|
type ErrSystem interface {
|
2018-03-05 22:39:07 +00:00
|
|
|
System()
|
2017-07-19 14:20:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// ErrNotModified signals that an action can't be performed because it's already in the desired state
|
|
|
|
type ErrNotModified interface {
|
|
|
|
NotModified()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrNotImplemented signals that the requested action/feature is not implemented on the system as configured.
|
|
|
|
type ErrNotImplemented interface {
|
|
|
|
NotImplemented()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrUnknown signals that the kind of error that occurred is not known.
|
|
|
|
type ErrUnknown interface {
|
|
|
|
Unknown()
|
|
|
|
}
|
2017-11-29 04:09:37 +00:00
|
|
|
|
|
|
|
// ErrCancelled signals that the action was cancelled.
|
|
|
|
type ErrCancelled interface {
|
|
|
|
Cancelled()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrDeadline signals that the deadline was reached before the action completed.
|
|
|
|
type ErrDeadline interface {
|
|
|
|
DeadlineExceeded()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrDataLoss indicates that data was lost or there is data corruption.
|
|
|
|
type ErrDataLoss interface {
|
|
|
|
DataLoss()
|
|
|
|
}
|