errors

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(code string, message string, statusCode ...int) Error

func (Error) Code

func (err Error) Code() string

func (Error) Details added in v0.4.5

func (err Error) Details() string

func (Error) Error

func (err Error) Error() string

func (Error) ErrorDocument

func (err Error) ErrorDocument(s *jsoniter.Stream)

func (Error) Expect

func (err Error) Expect() string

func (Error) JsonEncode

func (err Error) JsonEncode(s *jsoniter.Stream)

func (Error) Location

func (err Error) Location() string

func (Error) Message

func (err Error) Message() string

func (*Error) Reset

func (err *Error) Reset()

func (Error) Status

func (err Error) Status() int

func (Error) String

func (err Error) String() string

type ErrorDocumentor

type ErrorDocumentor interface {
	Status() int
	ErrorDocument(s *jsoniter.Stream)
}

type Errors

type Errors []Error

func (*Errors) Append

func (errs *Errors) Append(err Error)

func (Errors) Error

func (errs Errors) Error() string

func (Errors) ErrorDocument

func (errs Errors) ErrorDocument(s *jsoniter.Stream)

func (Errors) HasError

func (errs Errors) HasError() bool

func (Errors) JsonEncode

func (errs Errors) JsonEncode(s *jsoniter.Stream)

func (Errors) Len

func (errs Errors) Len() int

func (*Errors) Merge

func (errs *Errors) Merge(errors Errors)

func (*Errors) Reset

func (errs *Errors) Reset()

func (Errors) Status

func (errs Errors) Status() int

func (Errors) String

func (errs Errors) String() string

type FrozenError

type FrozenError interface {
	ErrorDocumentor
	Explained(location string, expect ...string) Error
	Detailed(details string, location ...string) Error
}

An immutable error used for spawning new "explained" errors.

func NewFrozenError

func NewFrozenError(code string, message string, statusCode ...int) FrozenError

Create an immutable ("frozen") error that is used for spawning new "explained" errors.

Jump to

Keyboard shortcuts

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