exceptional v2.1.0 Release Notes

Release Date: 2016-12-28 // about 3 years ago
  • ➕ Added ensure!/1 and def!/2

    ensure is essentially an alias for foo >>> fn x -> x end.()

    ensure!([1, 2, 3])#=\> [1, 2, 3]%ArgumentError{message: "raise me"} |\> ensure!#=\> \*\* (ArgumentError) raise me
    

    👻 def! foo(...) helps define a def foo(...) plus def foo!(...) variant that raises any final exception from foo

    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