Help us shape the future of Go! Take the 2026 Go Developer Survey

exception

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatchDebug

func CatchDebug()

CatchDebug Catch the exception and print debug info

func CatchPrint

func CatchPrint()

CatchPrint Catch the exception and print it

Types

type Exception

type Exception struct {
	Message string      `json:"message"`
	Code    int         `json:"code"`
	Context interface{} `json:"context"`
}

Exception the Exception type

func Err

func Err(err error, code int) *Exception

Err Create an exception instance from the error

func New

func New(message string, code int, args ...interface{}) *Exception

New Create a new exception instance

func (*Exception) Ctx

func (exception *Exception) Ctx(context interface{}) *Exception

Ctx Add the context for the exception.

func (*Exception) Print

func (exception *Exception) Print()

Print print the exception

func (*Exception) String

func (exception *Exception) String() string

String interface

func (*Exception) Throw

func (exception *Exception) Throw()

Throw Throw the exception and terminal progress.

Jump to

Keyboard shortcuts

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