stackerr: github.com/efimovalex/stackerr Index | Files | Directories

package stackerr

import "github.com/efimovalex/stackerr"

Index

Package Files

goerr.go stack.go

type Err Uses

type Err struct {
    Message    string
    StatusCode int
    // contains filtered or unexported fields
}

Err error

func New Uses

func New(message string) *Err

New - creates a new Err struct with 500 Error Code

func NewFromError Uses

func NewFromError(e error) *Err

NewFromError - creates a new Err struct with a custom Error Code

func NewWithStatusCode Uses

func NewWithStatusCode(message string, statusCode int) *Err

NewWithStatusCode - creates a new Err struct with a custom Error Code

func (*Err) Error Uses

func (e *Err) Error() string

func (*Err) IsNotFound Uses

func (e *Err) IsNotFound() bool

IsNotFound - return true if the error type is resource not found.

func (*Err) Log Uses

func (e *Err) Log()

Log - logs the Stacktrace using the native log package

func (*Err) Print Uses

func (e *Err) Print()

Print - prints the Stacktrace

func (*Err) Sprint Uses

func (e *Err) Sprint() string

Sprint - returns a pretty printed string of the Stacktrace ready for printng

func (*Err) Stack Uses

func (e *Err) Stack() *Err

Stack - Adds the current function to Err and a link to the previous Stacktrace

func (*Err) StackWithContext Uses

func (e *Err) StackWithContext(context string) *Err

StackWithContext - Adds the current function and context to Err and a link to the previous Stacktrace

type Stack Uses

type Stack struct {
    File          string
    Line          int
    Function      string
    Context       string
    CallbackStack *Stack
}

Stack - contains stack info

func (*Stack) Sprint Uses

func (s *Stack) Sprint() string

Sprint returns a pretty printed string of the Stacktrace ready for printng

Directories

PathSynopsis
example

Package stackerr imports 6 packages (graph) and is imported by 1 packages. Updated 2019-01-31. Refresh now. Tools for package owners.