View Source Bond.CheckError exception (Bond v1.7.0)

Exception raised when a Bond.check/1 assertion fails.

Summary

Types

t()

The Bond.CheckError exception type.

Types

@type t() :: %Bond.CheckError{
  __exception__: term(),
  binding: keyword(),
  expression: Bond.assertion_expression(),
  file: Path.t(),
  function: {String.t(), non_neg_integer()},
  impl: module() | nil,
  label: Bond.assertion_label(),
  line: integer(),
  module: module(),
  quantifier: map() | nil,
  source_behaviour: module() | nil,
  source_contract: {module(), atom()} | nil,
  source_protocol: module() | nil
}

The Bond.CheckError exception type.

:source_behaviour is the behaviour module an inherited contract came from (see Bond.Behaviour), or nil for a contract declared directly on the function.

:source_contract is the {module, name} of an applied named contract the failing assertion came from (see defcontract/@apply_contract), or nil otherwise.

:source_protocol is the protocol module a contract was declared on (see Bond.Protocol), or nil; when set, :impl is the implementation module the failing call resolved to (or nil if none could be resolved).

:quantifier carries element-level failure detail when the assertion used forall/exists (see Bond.Predicates), or nil otherwise.