exception

package
v0.0.0-...-de9fdfd Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(err error) bool

Types

type ExceptionData

type ExceptionData struct {
	Base    string
	Message string

	Level      Level
	Debug      *debug.Debug
	StackTrace []*debug.Debug
}

func Unwrap

func Unwrap(err error) (*ExceptionData, bool)

type Expection

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

func Create

func Create(format string, args ...any) *Expection

func From

func From(err error, dg *debug.Debug, otherwise ...string) *Expection

func (*Expection) Error

func (e *Expection) Error() string

func (*Expection) GetMessage

func (e *Expection) GetMessage(html bool) string

func (*Expection) HTML

func (e *Expection) HTML() *HtmlError

func (*Expection) JSON

func (e *Expection) JSON(pretty ...bool) ([]byte, error)

func (*Expection) WithBase

func (e *Expection) WithBase(err error) *Expection

func (*Expection) WithDebug

func (e *Expection) WithDebug(debug *debug.Debug) *Expection

func (*Expection) WithLevel

func (e *Expection) WithLevel(level Level) *Expection

func (*Expection) WithStatusCode

func (e *Expection) WithStatusCode(code int) *Expection

func (*Expection) WithTrace

func (e *Expection) WithTrace(trace *debug.Debug) *Expection

type HtmlError

type HtmlError struct {
	StatusCode int
	// contains filtered or unexported fields
}

func (*HtmlError) Error

func (he *HtmlError) Error() string

func (*HtmlError) GetPage

func (he *HtmlError) GetPage() string

Error returns the error message with HTML debug information

type JSONDebug

type JSONDebug struct {
	File      string `json:"file"`
	Line      int    `json:"line"`
	Column    int    `json:"column"`
	ColumnEnd int    `json:"column_end"`
}

type JSONError

type JSONError struct {
	Nubo JSONErrorNubo `json:"_nubo"`

	StatusCode int `json:"status_code,omitempty"`

	Level   Level        `json:"level"`
	Message string       `json:"message"`
	Debug   *JSONDebug   `json:"debug,omitempty"`
	Stack   []*JSONDebug `json:"stack,omitempty"`
	Near    string       `json:"near,omitempty"`
}

type JSONErrorNubo

type JSONErrorNubo struct {
	Version   string `json:"version"`
	GoVersion string `json:"go_version"`
	Docs      string `json:"docs"`
}

type Level

type Level string
const (
	LevelFatal Level = "FatalError"

	LevelSyntax   Level = "SyntaxError"
	LevelSemantic Level = "SemanticError"

	LevelRuntime Level = "RuntimeError"
	LevelType    Level = "TypeError"
	LevelValue   Level = "ValueError"
)

Jump to

Keyboard shortcuts

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