fcerror

package
v0.0.0-...-f1d6605 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTokenInvalid = iota + 200
	ErrUnauthorized
	ErrForbidden
	ErrPasswordHashingFailed
	ErrTokenNotFound
	ErrSessionExpired
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ID          ErrorID `json:"id"`
	Description string  `json:"description"`
	Cause       error   `json:"cause"`
	File        string  `json:"file,omitempty"`
	Line        int     `json:"line,omitempty"`
	Function    string  `json:"function,omitempty"`
}

func NewError

func NewError(id ErrorID, cause error) *Error

func NewErrorSkipFunc

func NewErrorSkipFunc(id ErrorID, cause error) *Error

func (Error) Error

func (err Error) Error() string

func (*Error) MarshalJSON

func (err *Error) MarshalJSON() ([]byte, error)

type ErrorID

type ErrorID int
const (
	ErrUnknown ErrorID = iota + 1
	ErrModelConversionFailed
	ErrBadRequest
	ErrInternalServerError
	ErrNotYetSupported
)
const (
	ErrDBTransactionCreationFailed ErrorID = iota + 300
	ErrDBWriteFailed
	ErrDBReadFailed
	ErrDBCommitFailed
	ErrDBRollbackFailed
	ErrDBAuthentication
	ErrDBUnavailable
	ErrDBCloseSessionFailed
	ErrDBInitializationFailed
	ErrDBCloseFailed
)
const (
	ErrFileFolderCreationFailed ErrorID = iota + 500
	ErrStorageOperationWithWrongUserPerspective
	ErrOpenUploadFile
	ErrOpenUserFile
	ErrCopyFileFailed
)
const (
	ErrUserNotFound ErrorID = iota + 100
	ErrEmailAlreadyRegistered
)
const (
	ErrNodeNotFound ErrorID = iota + 400
)
const (
	ErrShareContainsOtherShares ErrorID = iota + 600
)

Jump to

Keyboard shortcuts

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