View Source TypedStructor.Definer.Defexception (TypedStructor v0.5.0)

A definer to define an exception and a type for a given definition.

Additional options for typed_structor

  • :define_struct - if false, the type will be defined, but the struct will not be defined. Defaults to true.

Usage

defmodule MyException do
  use TypedStructor

  typed_structor definer: :defexception, define_struct: false do
    field :message, String.t()
  end
end

Summary

Functions

Defines an exception and a type for a given definition.

Functions

Link to this macro

define(definition)

View Source (macro)

Defines an exception and a type for a given definition.