Documentation ¶
Overview ¶
Package errtypes contains definitions for common errors. It would have nice to call this package errors, err or error but errors clashes with github.com/pkg/errors, err is used for any error variable and error is a reserved word :)
Index ¶
- Constants
- type AlreadyExists
- type BadRequest
- type ChecksumMismatch
- type InsufficientStorage
- type InternalError
- type InvalidCredentials
- type IsAlreadyExists
- type IsBadRequest
- type IsChecksumMismatch
- type IsInsufficientStorage
- type IsInternalError
- type IsInvalidCredentials
- type IsNotFound
- type IsNotSupported
- type IsPartialContent
- type IsPermissionDenied
- type IsUserRequired
- type NotFound
- type NotSupported
- type PartialContent
- type PermissionDenied
- type UserRequired
Constants ¶
const StatusChecksumMismatch = 419
StatusChecksumMismatch 419 is an unofficial http status code in an unassigned range that is used for checksum mismatches Proposed by https://stackoverflow.com/a/35665694 Official HTTP status code registry: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml Note: TUS uses unassigned 460 Checksum-Mismatch RFC proposal for checksum digest uses a `Want-Digest` header: https://tools.ietf.org/html/rfc3230 oc clienst issue: https://github.com/owncloud/core/issues/22711
const StatusInssufficientStorage = 507
StatusInssufficientStorage 507 is an official http status code to indicate that there is insufficient storage https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyExists ¶
type AlreadyExists string
AlreadyExists is the error to use when a resource something is not found.
func (AlreadyExists) Error ¶
func (e AlreadyExists) Error() string
func (AlreadyExists) IsAlreadyExists ¶
func (e AlreadyExists) IsAlreadyExists()
IsAlreadyExists implements the IsAlreadyExists interface.
type BadRequest ¶ added in v0.0.2
type BadRequest string
BadRequest is the error to use when the server cannot or will not process the request (due to a client error). Reauthenticating won't help.
func (BadRequest) Error ¶ added in v0.0.2
func (e BadRequest) Error() string
func (BadRequest) IsBadRequest ¶ added in v0.0.2
func (e BadRequest) IsBadRequest()
IsBadRequest implements the IsBadRequest interface.
type ChecksumMismatch ¶ added in v0.0.2
type ChecksumMismatch string
ChecksumMismatch is the error to use when the sent hash does not match the calculated hash.
func (ChecksumMismatch) Error ¶ added in v0.0.2
func (e ChecksumMismatch) Error() string
func (ChecksumMismatch) IsChecksumMismatch ¶ added in v0.0.2
func (e ChecksumMismatch) IsChecksumMismatch()
IsChecksumMismatch implements the IsChecksumMismatch interface.
type InsufficientStorage ¶ added in v0.0.2
type InsufficientStorage string
InsufficientStorage is the error to use when there is insufficient storage.
func (InsufficientStorage) Error ¶ added in v0.0.2
func (e InsufficientStorage) Error() string
func (InsufficientStorage) IsInsufficientStorage ¶ added in v0.0.2
func (e InsufficientStorage) IsInsufficientStorage()
IsInsufficientStorage implements the IsInsufficientStorage interface.
type InternalError ¶ added in v0.0.2
type InternalError string
InternalError is the error to use when we really don't know what happened. Use with care
func (InternalError) Error ¶ added in v0.0.2
func (e InternalError) Error() string
func (InternalError) IsInternalError ¶ added in v0.0.2
func (e InternalError) IsInternalError()
IsInternalError implements the IsInternalError interface.
type InvalidCredentials ¶
type InvalidCredentials string
InvalidCredentials is the error to use when receiving invalid credentials.
func (InvalidCredentials) Error ¶
func (e InvalidCredentials) Error() string
func (InvalidCredentials) IsInvalidCredentials ¶
func (e InvalidCredentials) IsInvalidCredentials()
IsInvalidCredentials implements the IsInvalidCredentials interface.
type IsAlreadyExists ¶
type IsAlreadyExists interface {
IsAlreadyExists()
}
IsAlreadyExists is the interface to implement to specify that a resource already exists.
type IsBadRequest ¶ added in v0.0.2
type IsBadRequest interface {
IsBadRequest()
}
IsBadRequest is the interface to implement to specify that the server cannot or will not process the request.
type IsChecksumMismatch ¶ added in v0.0.2
type IsChecksumMismatch interface {
IsChecksumMismatch()
}
IsChecksumMismatch is the interface to implement to specify that a checksum does not match.
type IsInsufficientStorage ¶ added in v0.0.2
type IsInsufficientStorage interface {
IsInsufficientStorage()
}
IsInsufficientStorage is the interface to implement to specify that a there is insufficient storage.
type IsInternalError ¶ added in v0.0.2
type IsInternalError interface {
IsInternalError()
}
IsInternalError is the interface to implement to specify that there was some internal error
type IsInvalidCredentials ¶
type IsInvalidCredentials interface {
IsInvalidCredentials()
}
IsInvalidCredentials is the interface to implement to specify that credentials were wrong.
type IsNotFound ¶
type IsNotFound interface {
IsNotFound()
}
IsNotFound is the interface to implement to specify that an a resource is not found.
type IsNotSupported ¶
type IsNotSupported interface {
IsNotSupported()
}
IsNotSupported is the interface to implement to specify that an action is not supported.
type IsPartialContent ¶ added in v0.0.2
type IsPartialContent interface {
IsPartialContent()
}
IsPartialContent is the interface to implement to specify that the client request has partial data.
type IsPermissionDenied ¶ added in v0.0.2
type IsPermissionDenied interface {
IsPermissionDenied()
}
IsPermissionDenied is the interface to implement to specify that an action is denied.
type IsUserRequired ¶
type IsUserRequired interface {
IsUserRequired()
}
IsUserRequired is the interface to implement to specify that a user is required.
type NotFound ¶
type NotFound string
NotFound is the error to use when a something is not found.
func (NotFound) IsNotFound ¶
func (e NotFound) IsNotFound()
IsNotFound implements the IsNotFound interface.
type NotSupported ¶
type NotSupported string
NotSupported is the error to use when an action is not supported.
func (NotSupported) Error ¶
func (e NotSupported) Error() string
func (NotSupported) IsNotSupported ¶
func (e NotSupported) IsNotSupported()
IsNotSupported implements the IsNotSupported interface.
type PartialContent ¶ added in v0.0.2
type PartialContent string
PartialContent is the error to use when the client request has partial data.
func (PartialContent) Error ¶ added in v0.0.2
func (e PartialContent) Error() string
func (PartialContent) IsPartialContent ¶ added in v0.0.2
func (e PartialContent) IsPartialContent()
IsPartialContent implements the IsPartialContent interface.
type PermissionDenied ¶ added in v0.0.2
type PermissionDenied string
PermissionDenied is the error to use when a resource cannot be access because of missing permissions.
func (PermissionDenied) Error ¶ added in v0.0.2
func (e PermissionDenied) Error() string
func (PermissionDenied) IsPermissionDenied ¶ added in v0.0.2
func (e PermissionDenied) IsPermissionDenied()
IsPermissionDenied implements the IsPermissionDenied interface.
type UserRequired ¶
type UserRequired string
UserRequired represents an error when a resource is not found.
func (UserRequired) Error ¶
func (e UserRequired) Error() string
func (UserRequired) IsUserRequired ¶
func (e UserRequired) IsUserRequired()
IsUserRequired implements the IsUserRequired interface.