ExceptionHelper

package
v1.1.153 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Throw

func Throw(code int, message string, param ...interface{})

func ThrowLog added in v1.1.45

func ThrowLog(code int, message string, param ...interface{})

抛异常

Types

type Exception

type Exception struct {
	Code    int
	Message string
}

type ExceptionHandler

type ExceptionHandler func(Exception)

type ExceptionStruct

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

func Try

func Try(handler func()) *ExceptionStruct

尝试

func (*ExceptionStruct) Catch

func (ex *ExceptionStruct) Catch(catch func(Exception)) *ExceptionStruct

捕获异常方法设置

func (*ExceptionStruct) Exc

func (ex *ExceptionStruct) Exc()

这里总体执行

func (*ExceptionStruct) Finally

func (ex *ExceptionStruct) Finally(finally func()) *ExceptionStruct

最终都要执行的方法

Jump to

Keyboard shortcuts

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