errtypes

package
v3.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 5

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

View Source
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

View Source
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

func Join

func Join(err ...error) error

Join returns an error representing a list of errors.

Types

type AlreadyExists

type AlreadyExists string

AlreadyExists is the error to use when a resource already exists and can't be overwritten.

func (AlreadyExists) Error

func (e AlreadyExists) Error() string

func (AlreadyExists) IsAlreadyExists

func (e AlreadyExists) IsAlreadyExists()

IsAlreadyExists implements the IsAlreadyExists interface.

type BadRequest

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

func (e BadRequest) Error() string

func (BadRequest) IsBadRequest

func (e BadRequest) IsBadRequest()

IsBadRequest implements the IsBadRequest interface.

type ChecksumMismatch

type ChecksumMismatch string

ChecksumMismatch is the error to use when the sent hash does not match the calculated hash.

func (ChecksumMismatch) Error

func (e ChecksumMismatch) Error() string

func (ChecksumMismatch) IsChecksumMismatch

func (e ChecksumMismatch) IsChecksumMismatch()

IsChecksumMismatch implements the IsChecksumMismatch interface.

type Conflict

type Conflict string

Conflict is the error to use when the server found a conflict when processing the request (e.g. with an existing lock).

func (Conflict) Error

func (e Conflict) Error() string

func (Conflict) IsConflict

func (e Conflict) IsConflict()

IsConflict implements the IsConflict interface.

type InsufficientStorage

type InsufficientStorage string

InsufficientStorage is the error to use when there is insufficient storage.

func (InsufficientStorage) Error

func (e InsufficientStorage) Error() string

func (InsufficientStorage) IsInsufficientStorage

func (e InsufficientStorage) IsInsufficientStorage()

IsInsufficientStorage implements the IsInsufficientStorage interface.

type InternalError

type InternalError string

InternalError is the error to use when we really don't know what happened. Use with care.

func (InternalError) Error

func (e InternalError) Error() string

func (InternalError) IsInternalError

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

type IsBadRequest interface {
	IsBadRequest()
}

IsBadRequest is the interface to implement to specify that the server cannot or will not process the request.

type IsChecksumMismatch

type IsChecksumMismatch interface {
	IsChecksumMismatch()
}

IsChecksumMismatch is the interface to implement to specify that a checksum does not match.

type IsInsufficientStorage

type IsInsufficientStorage interface {
	IsInsufficientStorage()
}

IsInsufficientStorage is the interface to implement to specify that there is insufficient storage.

type IsInternalError

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

type IsPartialContent interface {
	IsPartialContent()
}

IsPartialContent is the interface to implement to specify that the client request has partial data.

type IsPermissionDenied

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 something is not found.

func (NotFound) Error

func (e NotFound) Error() string

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

type PartialContent string

PartialContent is the error to use when the client request has partial data.

func (PartialContent) Error

func (e PartialContent) Error() string

func (PartialContent) IsPartialContent

func (e PartialContent) IsPartialContent()

IsPartialContent implements the IsPartialContent interface.

type PermissionDenied

type PermissionDenied string

PermissionDenied is the error to use when a resource cannot be access because of missing permissions.

func (PermissionDenied) Error

func (e PermissionDenied) Error() string

func (PermissionDenied) IsPermissionDenied

func (e PermissionDenied) IsPermissionDenied()

IsPermissionDenied implements the IsPermissionDenied interface.

type UserRequired

type UserRequired string

UserRequired represents an error when a user could not be found from the context.

func (UserRequired) Error

func (e UserRequired) Error() string

func (UserRequired) IsUserRequired

func (e UserRequired) IsUserRequired()

IsUserRequired implements the IsUserRequired interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL