mix new example_errorcd example_error- Edit
lib/example_error.ex iex -S mix- Enter the following command:
try do
raise ExampleError
rescue
e in ExampleError -> e
end| defmodule ExampleError do | |
| defexception message: "an example error has occurred" | |
| end |