hamiltop / rethinkdb-elixir

Rethinkdb client in pure elixir (JSON protocol)
MIT License
497 stars 64 forks source link

run! function that raises error #143

Open norpan opened 7 years ago

norpan commented 7 years ago

How about having a additional run! function that raises an error instead of returning {:error, ...}? This seems to be the canonical elixir way to do things and would make it easier to write code and not have to pattern match :ok on each call.

queer commented 6 years ago

This might not be the solution you want (and this is an amazingly-late response), but you could write a bangify function (used like this).

norpan commented 6 years ago

Indeed one could write such a function, but Elixir itself has different versions of functions so it makes sense to supply these in this library as well. Otherwise every user has to research and implement these themselves.