cerror

package
v0.0.0-...-e306fef Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: GPL-3.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

View Source
const (
	AlreadyClaimed             = "already-claimed"
	AlreadyOwned               = "already-owned"
	AlreadyRegistered          = "already-registered"
	AssertionCreationFailed    = "assertion-creation-failed"
	BadRequest                 = "bad-request"
	DatabaseError              = "database-error"
	FailedToRegister           = "failed-to-register"
	FeatureDisabled            = "feature-disabled"
	InternalServerError        = "internal-server-error"
	Invalid                    = "invalid"
	InvalidChoice              = "invalid-choice"
	InvalidField               = "invalid-field"
	MacaroonPermissionRequired = "macaroon-permission-required"
	MediaFileSizeTooBig        = "media-file-size-too-big"
	MediaInvalidAspectRatio    = "media-invalid-aspect-ratio"
	MediaInvalidResolution     = "media-invalid-resolution"
	MediaModified              = "media-modified"
	MediaTooManyItems          = "media-too-many-items"
	MediaUnsupportedType       = "media-unsupported-type"
	MissingField               = "missing-field"
	NameNotAvailableForDispute = "name-not-available-for-dispute"
	NameNotRegistered          = "name-not-registered"
	NotImplemented             = "not-implemented"
	RegisterWindow             = "register-window"
	Required                   = "required"
	ReservedName               = "reserved-name"
	ResourceForbidden          = "resource-forbidden"
	ResourceNotFound           = "resource-not-found"
	ResourceNotReady           = "resource-not-ready"
	RevokedName                = "revoked-name"
	Unauthorized               = "unauthorized"
	UserNotReady               = "user-not-ready"
)

Variables

This section is empty.

Functions

func FormatBindError

func FormatBindError(err error) string

Types

type CustomError

type CustomError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

func ConvertError

func ConvertError(err error, message ...string) *CustomError

func NewCustomError

func NewCustomError(code, message string) *CustomError

func (*CustomError) GetCode

func (e *CustomError) GetCode() string

func (*CustomError) GetMessage

func (e *CustomError) GetMessage() string

type ErrorList

type ErrorList []*CustomError

func NewError

func NewError(code, message string) *ErrorList

func NewErrorList

func NewErrorList() *ErrorList

func (*ErrorList) Add

func (el *ErrorList) Add(code, message string)

func (*ErrorList) AddCustomError

func (el *ErrorList) AddCustomError(err *CustomError)

AddCustomError adds a custom error to the error-list.

func (*ErrorList) ConvertToProtoErrorList

func (el *ErrorList) ConvertToProtoErrorList() []*cerrorpb.Error

func (*ErrorList) Extend

func (el *ErrorList) Extend(other ErrorList)

func (*ErrorList) ExtendProtoError

func (el *ErrorList) ExtendProtoError(other []*cerrorpb.Error)

func (*ErrorList) GetHTTPStatus

func (el *ErrorList) GetHTTPStatus() int

func (*ErrorList) HasError

func (el *ErrorList) HasError() bool

func (*ErrorList) RemoveErrorWithCode

func (el *ErrorList) RemoveErrorWithCode(errorCode string)

func (*ErrorList) Scan

func (el *ErrorList) Scan(value interface{}) error

func (ErrorList) Value

func (el ErrorList) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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