defs.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package errdefs
  2. // ErrNotFound signals that the requested object doesn't exist
  3. type ErrNotFound interface {
  4. NotFound()
  5. }
  6. // ErrInvalidParameter signals that the user input is invalid
  7. type ErrInvalidParameter interface {
  8. InvalidParameter()
  9. }
  10. // ErrConflict signals that some internal state conflicts with the requested action and can't be performed.
  11. // A change in state should be able to clear this error.
  12. type ErrConflict interface {
  13. Conflict()
  14. }
  15. // ErrUnauthorized is used to signify that the user is not authorized to perform a specific action
  16. type ErrUnauthorized interface {
  17. Unauthorized()
  18. }
  19. // ErrUnavailable signals that the requested action/subsystem is not available.
  20. type ErrUnavailable interface {
  21. Unavailable()
  22. }
  23. // ErrForbidden signals that the requested action cannot be performed under any circumstances.
  24. // When a ErrForbidden is returned, the caller should never retry the action.
  25. type ErrForbidden interface {
  26. Forbidden()
  27. }
  28. // ErrSystem signals that some internal error occurred.
  29. // An example of this would be a failed mount request.
  30. type ErrSystem interface {
  31. ErrSystem()
  32. }
  33. // ErrNotModified signals that an action can't be performed because it's already in the desired state
  34. type ErrNotModified interface {
  35. NotModified()
  36. }
  37. // ErrNotImplemented signals that the requested action/feature is not implemented on the system as configured.
  38. type ErrNotImplemented interface {
  39. NotImplemented()
  40. }
  41. // ErrUnknown signals that the kind of error that occurred is not known.
  42. type ErrUnknown interface {
  43. Unknown()
  44. }