Documentation
¶
Index ¶
- Constants
- func FormatBindError(err error) string
- type CustomError
- type ErrorList
- func (el *ErrorList) Add(code, message string)
- func (el *ErrorList) AddCustomError(err *CustomError)
- func (el *ErrorList) ConvertToProtoErrorList() []*cerrorpb.Error
- func (el *ErrorList) Extend(other ErrorList)
- func (el *ErrorList) ExtendProtoError(other []*cerrorpb.Error)
- func (el *ErrorList) GetHTTPStatus() int
- func (el *ErrorList) HasError() bool
- func (el *ErrorList) RemoveErrorWithCode(errorCode string)
- func (el *ErrorList) Scan(value interface{}) error
- func (el ErrorList) Value() (driver.Value, error)
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" UserNotReady = "user-not-ready" )
Variables ¶
This section is empty.
Functions ¶
func FormatBindError ¶
Types ¶
type CustomError ¶
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 NewErrorList ¶
func NewErrorList() *ErrorList
func (*ErrorList) AddCustomError ¶
func (el *ErrorList) AddCustomError(err *CustomError)
AddCustomError adds a custom error to the error-list.
func (*ErrorList) ConvertToProtoErrorList ¶
func (*ErrorList) ExtendProtoError ¶
func (*ErrorList) GetHTTPStatus ¶
func (*ErrorList) RemoveErrorWithCode ¶
Click to show internal directories.
Click to hide internal directories.