View Source Zest (bonfire v0.3.5-classic-beta.4)

Link to this section Summary

Functions

Iterates over a collections, calling the provided effectful function with each item.

Iterates over two collections, calling the provided effectful function with each pair of items

You take on the role of the apply function in this exciting function that wraps execution of a function such that your function is responsible for calling it.

Add some debug information to the context for the duration of a function's execution. If a raise, throw or exit occurs, the context will be pretty printed to the screen to aid with debugging.

Catches errors and exceptions, invoking an interceptor function

An interceptor function which simply rethrows/reraises/re-exits

Wraps an interceptor or nullary function into an interceptor function such that after the execution of the provided function, the error or exception will be rethrown.

Add some debug information to the context for the duration of a block or expression. If a raise, throw or exit occurs, the context will be pretty printed to the screen to aid with debugging.

Wrap a function such that it is as if its body was wrapped in scope/2

Link to this section Types

@type intercept_type() :: :rescue | :catch | :exit
@type interceptor() ::
  (intercept_type(), error :: term(), maybe_stacktrace :: term() -> term())

Link to this section Functions

Iterates over a collections, calling the provided effectful function with each item.

Iterates over two collections, calling the provided effectful function with each pair of items

@spec hijack(function(), jack :: (function(), [term()] -> term())) :: function()

You take on the role of the apply function in this exciting function that wraps execution of a function such that your function is responsible for calling it.

@spec in_scope(Keyword.t(), function()) :: term()

Add some debug information to the context for the duration of a function's execution. If a raise, throw or exit occurs, the context will be pretty printed to the screen to aid with debugging.

Link to this function

intercept(fun, interceptor)

View Source
@spec intercept(function(), interceptor()) :: function()

Catches errors and exceptions, invoking an interceptor function

Link to this function

rethrow(atom, e, stacktrace)

View Source
@spec rethrow(intercept_type(), error :: term(), maybe_stacktrace :: term()) :: none()

An interceptor function which simply rethrows/reraises/re-exits

@spec rethrowing(function()) :: function()

Wraps an interceptor or nullary function into an interceptor function such that after the execution of the provided function, the error or exception will be rethrown.

Link to this macro

scope(list, expr)

View Source (macro)

Add some debug information to the context for the duration of a block or expression. If a raise, throw or exit occurs, the context will be pretty printed to the screen to aid with debugging.

Examples:

scope [foo: :bar[, assert(true == false)

scope [foo: :bar] do assert true == false end

@spec scoped(Keyword.t(), region :: function()) :: function()

Wrap a function such that it is as if its body was wrapped in scope/2