errors

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPErrors permite crear HTTPError precreados
	HTTPErrors = httpErrors{}
)

Functions

This section is empty.

Types

type Error

type Error interface {
	Error() string
	StackTrace() []Frame
	Unwrap() error
}

Error .

type Frame

type Frame struct {
	// Func contains a function name.
	Func string
	// Line contains a line number.
	Line int
	// Path contains a file path.
	Path string
}

Frame .

func ErrorStackTrace

func ErrorStackTrace(skip int) []Frame

ErrorStackTrace . skip Es la posicion de donde comienza el tracking del error El valor de skip debe empezar en "2" para no tomar en cuenta esta funcion "errorStackTrace()" Con esto tenemos un mejor y claro tracking

type HTTPError

type HTTPError struct {
	StatusCode int    `json:"statusCode"`
	Success    bool   `json:"success"`
	MessageID  string `json:"messageId"`

	Data    map[string]interface{} `json:"data,omitempty"`
	Message string                 `json:"message"`
}

HTTPError .

func (HTTPError) Unwrap

func (e HTTPError) Unwrap() error

Unwrap returns the original error.

type HTTPErrorConfig

type HTTPErrorConfig struct {
	Message     lang.Message
	Data        map[string]interface{}
	HideData    bool
	ReportError bool
}

HTTPErrorConfig .

type HTTPErrorPanic

type HTTPErrorPanic struct {
	StatusCode  int                    `json:"statusCode"`
	MessageID   string                 `json:"messageId"`
	ReportError bool                   `json:"reportError"`
	Data        map[string]interface{} `json:"data,omitempty"`
	Message     string                 `json:"message"`
	Frames      []Frame                `json:"frames,omitempty"`
}

Jump to

Keyboard shortcuts

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