exceptional v2.1.0 Release Notes
Release Date: 2016-12-28 // over 7 years ago-
➕ Added
ensure!/1
anddef!/2
ensure
is essentially an alias forfoo >>> fn x -> x end.()
ensure!([1, 2, 3])#=\> [1, 2, 3]%ArgumentError{message: "raise me"} |\> ensure!#=\> \*\* (ArgumentError) raise me
👻
def! foo(...)
helps define adef foo(...)
plusdef foo!(...)
variant that raises any final exception fromfoo
defmodule Foo douse Exceptional def! foo(a), do: aendFoo.foo([1, 2, 3])#=\> [1, 2, 3]Foo.foo(%ArgumentError{message: "raise me"})#=\> %ArgumentError{message: "raise me"}Foo.foo!([1, 2, 3])#=\> [1, 2, 3]Foo.foo!(%ArgumentError{message: "raise me"})#=\> \*\* (ArgumentError) raise me
Previous changes from v2.0.0
-
Phoenix/Exceptional helpers now live here