Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error func(e interface{})
Error abstracts passing code blocks to handle errors generated
type TryStatement ¶
type TryStatement struct {
// contains filtered or unexported fields
}
TryStatement is the type returned on execution of package function Try.. This enables chaining functions that compose the try/catch/finally statement.
func Run ¶
func Run(t Task) TryStatement
Run initializes the try statement. The function passed is stored, to be ran later.
func (TryStatement) Catch ¶
func (t TryStatement) Catch(e Error) TryStatement
Catch stores the error handler code block to the Try Statement.
func (TryStatement) Finally ¶
func (t TryStatement) Finally(task Task)
Finally executes the statement and recovers from any panics.
Click to show internal directories.
Click to hide internal directories.