errors

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Return

func Return(errs ...error) (ptrSize uint64)

func Write

func Write(errs ...error)

Types

type Error

type Error struct {
	Message       string                    `json:"message"`
	Stack         string                    `json:"stack,omitempty"`
	Nodes         []ast.Node                `json:"-"`
	Source        *source.Source            `json:"source,omitempty"`
	Positions     []uint                    `json:"positions,omitempty"`
	Locations     []location.SourceLocation `json:"locations,omitempty"`
	OriginalError error                     `json:"-"`
	Path          []interface{}             `json:"path,omitempty"`
}

func NewError

func NewError(message string, nodes []ast.Node, stack string, source *source.Source, positions []uint, origError error) *Error

func NewErrorWithPath

func NewErrorWithPath(message string, nodes []ast.Node, stack string, source *source.Source, positions []uint, path []interface{}, origError error) *Error

func NewSyntaxError

func NewSyntaxError(s *source.Source, position uint, description string) *Error

func (Error) Error

func (g Error) Error() string

implements Golang's built-in `error` interface

func (Error) MarshalJSON

func (v Error) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Error) MarshalTinyJSON

func (v Error) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Error) UnmarshalJSON

func (v *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Error) UnmarshalTinyJSON

func (v *Error) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Errors

type Errors []*Error

func Convert

func Convert(errs ...error) Errors

Jump to

Keyboard shortcuts

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