package
Version:
v1.8.0
Opens a new window with list of versions in this module.
Published: Aug 16, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 5
Opens a new window with list of known importers.
README
¶
Try-Finally-Catch
Usage
Quick usage
import "github.com/gflydev/core/try"
try.Perform(func() {
calledTry()
}).Finally(func() {
calledFinally()
}).Catch(func(e try.E) {
log.Errorf("Catch error %v", e)
})
Documentation
¶
RethrowPanic Special re-throw panic
Throw function (return or rethrow an exception)
type It struct {
Error E
}
It structure
func Perform(funcToTry F) (o *It)
Perform register the main-logic function.
func (o *It) Catch(funcCaught EF) *It
Catch register the finally-logic function.
func (o *It) Finally(finallyFunc F) *It
Finally register the finally-logic function.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.