Packages

This library is meant to provide an ergonomic way to match, compare and bind data in complex types such as maps and structs.

Current section

Files

Jump to
exmatch lib exception.ex
Raw

lib/exception.ex

defmodule ExMatch.Exception do
defstruct [:class, :error, :stacktrace]
def new(class, error, stacktrace) do
%__MODULE__{class: class, error: error, stacktrace: stacktrace}
end
defimpl Inspect do
alias ExMatch.Exception, as: Self
def inspect(%Self{} = self, _opts) do
Exception.format(self.class, self.error, self.stacktrace)
|> String.trim_trailing()
end
end
end