Today I Learned

hashrocket A Hashrocket project

Elixir Exceptions are Structs

Elixir Exceptions are actually Structs:

Map.keys %RuntimeError{}
#=> [:__exception__, :__struct__, :message]

%RuntimeError{}.message
#=> "runtime error"

This is also true when you define an Exception with defexception.

See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.