try

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(fn func(), cfn ...CatchFunc)

执行

func Go

func Go(fn func(), efn ...CatchFunc)

执行协程

func Throw

func Throw(code int32, args ...any)

抛出异常

func Throwf

func Throwf(code int32, format string, args ...any)

抛出异常并格式化

Types

type BaseException

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

func (*BaseException) ErrCode

func (this *BaseException) ErrCode() int32

错误代号

func (*BaseException) ErrMsg

func (this *BaseException) ErrMsg() string

错误消息

type CatchFunc

type CatchFunc func(e Exception)

type Exception

type Exception interface {
	ErrCode() int32
	ErrMsg() string
}

Jump to

Keyboard shortcuts

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