eagrors

package
v0.0.0-...-26b8db2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package eagrors contains common eago erros and related utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FprintStackError

func FprintStackError(l interface{ Error(...interface{}) }, err error)

FprintStackError print errors and causes to given error logger

func FprintStackTraceFromErr

func FprintStackTraceFromErr(w io.Writer, err error)

FprintStackTraceFromErr prints the error's stack trace to w.

func GetErrorString

func GetErrorString(err error) string

GetErrorString returns errors string of an error if it StackError then get all cause

func GetGID

func GetGID() uint64

GetGID gets the current goroutine id. Used only for debugging.

func HandleErrors

func HandleErrors(_errors ...error) error

HandleErrors return first error which is not nil

func NewError

func NewError(errStr string) error

NewError returns new stack error

func NewErrorWithCause

func NewErrorWithCause(cause error, err string) error

NewErrorWithCause creates a stack error with given error

func NewProcessExitError

func NewProcessExitError(code int) error

NewProcessExitError :

func PrintError

func PrintError(err error)

PrintError print errors and causes to default logger

func PrintStackTrace

func PrintStackTrace(w io.Writer)

PrintStackTrace prints the current stacktrace to w.

func PrintStackTraceFromErr

func PrintStackTraceFromErr(err error)

PrintStackTraceFromErr prints the error's stack trace to stdout.

func Recover

func Recover(args ...interface{})

Recover :

func RecoverRuntime

func RecoverRuntime(method, url string)

RecoverRuntime :

Types

type ArgumentCountError

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

ArgumentCountError invokes when otto function is passed by unexpected number of parameters

func NewArgumentCountError

func NewArgumentCountError(want, got int) *ArgumentCountError

NewArgumentCountError :

func (ArgumentCountError) Error

func (e ArgumentCountError) Error() string

func (ArgumentCountError) JSError

func (e ArgumentCountError) JSError(vm *otto.Otto) otto.Value

JSError return otto error

type ErrorSender

type ErrorSender interface {
	SendError(err error)
}

ErrorSender is a, typically, non-blocking error handler.

type FileError

type FileError interface {
	error
	Position() text.Position
}

FileError represent errors that invoked when handling, executing, parsing a file

type ProcessExitError

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

ProcessExitError invokes when error occured on JS process or process.exit function executed

func (ProcessExitError) Error

func (p ProcessExitError) Error() string

type StackError

type StackError interface {
	error
	// contains filtered or unexported methods
}

StackError represents errors that refers another or referred from another error

Jump to

Keyboard shortcuts

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