Help us shape the future of Go! Take the 2026 Go Developer Survey

errwrap

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltinCallError added in v0.7.0

func BuiltinCallError(root, call ast.Node, name string, invokerAncestors []ast.Node) (title, message string, ok bool)

BuiltinCallError returns the error of a call to the built-in component name. call is the call or the parameter reference that renders the built-in, and its arguments, explicit or bound, are resolved with invokerAncestors as for ast.ResolveFrameParam.

func CallArgTypeError added in v0.7.0

func CallArgTypeError(root, call, compDef ast.Node, invokerAncestors []ast.Node) (title, message string, ok bool)

CallArgTypeError returns the error of a call to the local or global component compDef whose arguments forwarded from a parameter (`n = value`, `n = items[0]`) resolve to a value of the wrong type. invokerAncestors are as for ast.ResolveCompCallArgValue.

func CallArgsError added in v0.7.0

func CallArgsError(root, compCall ast.Node, invokerAncestors []ast.Node) (title, message string, ok bool)

CallArgsError returns the error of a component call whose arguments, including values inside arrays, records and bound arguments, use a context key that is not injected. invokerAncestors are as for ast.ResolveCompCallArgValue.

func CallSignature added in v0.7.0

func CallSignature(root, frame, compDef ast.Node, invokerAncestors []ast.Node) string

CallSignature identifies what a frame renders: the definitions the component parameters of compDef resolve to for frame. frame is a component call or a parameter reference that renders compDef, and invokerAncestors are as for ast.ResolveFrameParam. Entering compDef again with the same signature while it is being rendered never ends.

func DisallowedURLSchemeError added in v0.7.0

func DisallowedURLSchemeError(scheme string) (title, message string)

DisallowedURLSchemeError returns the error of a LINK or IMAGE argument or a markdown link URL whose scheme is not http, https, mailto or tel.

func InfiniteCallError added in v0.7.0

func InfiniteCallError(name string) (title, message string)

InfiniteCallError returns the error of a call to the component name that enters a component already being rendered with the same signature.

func InlineCompValueError added in v0.7.0

func InlineCompValueError(compName string, compDef ast.Node) (title, message string, ok bool)

InlineCompValueError returns the error of a parameter reference unit that renders the component compDef inline.

func InvalidParamDefinition added in v0.7.0

func InvalidParamDefinition(compDef ast.Node) (string, bool)

InvalidParamDefinition returns the first invalid parameter definition of a local or global component definition. It returns false for any other node.

func IsBlockComponent added in v0.7.0

func IsBlockComponent(compDef ast.Node) bool

IsBlockComponent reports whether the component compDef is a block component.

func ParamCompCallError added in v0.7.0

func ParamCompCallError(root, paramRef ast.Node, value ast.ResolvedValue, compDef ast.Node, invokerAncestors []ast.Node) (title, message string, ok bool)

ParamCompCallError returns the error of a call through a component parameter, paramRef, that renders the component value. compDef is the local or global definition the value resolved to, nil if there is none. invokerAncestors are as for ast.ResolveCompCallArgValue.

func ParamRefValueError added in v0.7.0

func ParamRefValueError(paramName string, value ast.ResolvedValue, accessors []ast.ValueAccessor) (title, message string, ok bool)

ParamRefValueError returns the error of a parameter reference unit whose parameter resolved to value. accessors are the accessors of the reference.

Types

type ErrorWrapper

type ErrorWrapper interface {
	Wrap(ast.Node)
}

func DefaultErrorWrapper

func DefaultErrorWrapper() ErrorWrapper

Jump to

Keyboard shortcuts

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