errs

package
v0.0.0-...-9b8a360 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Lexer errors
	ErrFailedToReadContent = fmt.Errorf("could not read content")
	SyntaxError            = fmt.Errorf("syntax error")

	// RuntimeError is the base error for all runtime issues.
	RuntimeError = fmt.Errorf("runtime error")
)

Functions

func WithDebug

func WithDebug(err error, debug *models.Debug) error

WithDebug adds debug information to an error

Types

type DebugError

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

DebugError is an error with debug information

func (DebugError) Error

func (de DebugError) Error() string

Error returns the error message with debug information

func (DebugError) GetColumn

func (de DebugError) GetColumn() int

func (DebugError) GetFile

func (de DebugError) GetFile() string

func (DebugError) GetLine

func (de DebugError) GetLine() int

func (DebugError) GetParentError

func (de DebugError) GetParentError() error

func (DebugError) HttpError

func (de DebugError) HttpError() *HtmlError

HttpError returns the error message with debug information for HTTP

func (DebugError) PrettyError

func (de DebugError) PrettyError(pf func(r io.Reader) string) string

type HtmlError

type HtmlError struct {
	Code []byte
	// contains filtered or unexported fields
}

HtmlError is an error with HTML debug information

func NewHtmlError

func NewHtmlError(de *DebugError) *HtmlError

NewHtmlError creates a new HtmlError

func (*HtmlError) Debug

func (he *HtmlError) Debug() *DebugError

func (*HtmlError) Error

func (he *HtmlError) Error() string

Error returns the error message with HTML debug information

Jump to

Keyboard shortcuts

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