Last active
August 29, 2018 15:35
-
-
Save sescobb27/b5c889f22f405f8e14b2e47ff37ffc36 to your computer and use it in GitHub Desktop.
throw vs raise elixir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
creating | handling with | where y is | |
----------------------------------------------------- | |
raise x | rescue y | %RuntimeError{message: x} | |
error(x) | rescue y | %ErlangError{original: x} | |
throw x | catch y | x | |
exit(x) | catch :exit, y | x | |
creating | handling with | where y is | and z is | |
----------------------------------------------------------------- | |
raise x | catch y, z | :error | %RuntimeError{message: x} | |
error(x) | catch y, z | :error | x | |
throw x | catch y, z | :throw | x | |
exit(x) | catch y, z | :exit | x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment