Trap, observe, and release an Elixir function's side effects
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
test
.coveralls.yml
.gitignore
LICENSE.txt
README.md
mix.exs
mix.lock
wercker.yml

README.md

Stifle

wercker status Hex.pm Version Coverage Status

Stifle is a library for suppressing side-effects (exits, raises, throws) in Elixir functions, allowing the developer to replay side effects in the current process or inspect the effect/return value safely.

Example

iex> raise_hell_fn = fn -> raise "hell" end
iex> stifled_fn = Stifle.stifle(raise_hell_fn)
iex> stifled_return_value = stifled_fn.() # => {:error, %RuntimeError{message: "hell"}, [...]}
iex> Stifle.unstifle(stifled_return_value)
** (RuntimeError) hell

Full Documentation

Full documentation is available on hexdocs.pm.

Authorship and License

Stifle is copyright 2016 Appcues, Inc.

Stifle is released under the MIT License.