api_errors

package
v0.2.24 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeNotFound     = "NOT_FOUND"
	CodeForbidden    = "FORBIDDEN"
	CodeBadInput     = "BAD_USER_INPUT"
	CodeInternal     = "INTERNAL_ERROR"
	CodeUnauthorized = "UNAUTHORIZED"
	CodeExists       = "ALREADY_EXISTS"
)

Variables

This section is empty.

Functions

func NewError added in v0.1.2

func NewError(message string, code string, extensions map[string]interface{}) *gqlerror.Error

NewError creates a standardized GraphQL error

Types

type ErrorInfo

type ErrorInfo struct {
	Message  string
	RawError error
}

type MultiErrors

type MultiErrors struct {
	Errors map[string][]ErrorInfo
}

func NewMultiErrors

func NewMultiErrors() *MultiErrors

func (*MultiErrors) Add

func (e *MultiErrors) Add(key, message string, err error)

func (*MultiErrors) Error

func (e *MultiErrors) Error() string

func (*MultiErrors) HasErrors

func (e *MultiErrors) HasErrors() bool

Jump to

Keyboard shortcuts

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