exception

package
v0.0.0-...-1489327 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: GPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exception

type Exception struct {
	Id  int    // exception id
	Msg string // exception msg
}

exception struct,describe information related to exceptions

func Throw

func Throw(id int, msg string) Exception

Function that throws an exception id: exception id msg: exception message

type ExceptionHandler

type ExceptionHandler func(Exception)

the function type that handles the catch part

type TryStruct

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

func Try

func Try(tryHandler func()) *TryStruct

Simulate the try part of the exception statement

func (*TryStruct) Catch

func (this *TryStruct) Catch(exceptionId int, catch func(Exception)) *TryStruct

the function that handles the catch part exceptionId: exception id catch: catch function

func (*TryStruct) Finally

func (this *TryStruct) Finally(finally func())

the function that handles the finally part

Jump to

Keyboard shortcuts

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