amos on Nostr: Usually there's two variants of a function in elixir, one that ends with ! and can ...
Usually there's two variants of a function in elixir, one that ends with ! and can throw an exception, and one that will return either {:error, result} or {:ok, result}.
I usually use the first option if I know there is no chance something will fail or I don't care if it fails, and the second option if I know there is a chance it will fail and I want to catch the error. Of course you can also catch exceptions, but I do that more as a catchall if I really don't want a process to crash.
I usually use the first option if I know there is no chance something will fail or I don't care if it fails, and the second option if I know there is a chance it will fail and I want to catch the error. Of course you can also catch exceptions, but I do that more as a catchall if I really don't want a process to crash.