errors

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: BSD-2-Clause Imports: 3 Imported by: 278 modules, 283 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ErrSyntax constErr = "graphql syntax error"

ErrSyntax marks GraphQL syntax parsing failures.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPanicHandler added in v1.3.0

type DefaultPanicHandler struct{}

DefaultPanicHandler is the default PanicHandler.

func (*DefaultPanicHandler) MakePanicError added in v1.3.0

func (h *DefaultPanicHandler) MakePanicError(ctx context.Context, value any) *QueryError

MakePanicError creates a new QueryError from a panic that occurred during execution.

type Location

type Location struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

func (Location) Before

func (a Location) Before(b Location) bool

type PanicHandler added in v1.3.0

type PanicHandler interface {
	MakePanicError(ctx context.Context, value any) *QueryError
}

PanicHandler is the interface used to create custom panic errors that occur during query execution.

type QueryError

type QueryError struct {
	Err           error          `json:"-"` // Err holds underlying if available
	Message       string         `json:"message"`
	Locations     []Location     `json:"locations,omitempty"`
	Path          []any          `json:"path,omitempty"`
	Rule          string         `json:"-"`
	ResolverError error          `json:"-"`
	Extensions    map[string]any `json:"extensions,omitempty"`
}

func Errorf

func Errorf(format string, a ...any) *QueryError

func (*QueryError) Error

func (err *QueryError) Error() string

func (*QueryError) Unwrap added in v1.1.0

func (err *QueryError) Unwrap() error

Jump to

Keyboard shortcuts

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