Spek.EvaluationError exception (Spek v0.1.2)

Copy Markdown View Source

Error representing a failed rule evaluation.

Summary

Types

t()

Struct returned or raised if an authorization check fails.

Functions

Returns a new EvaluationError struct.

Returns a new EvaluationError struct that contains the given expression.

Types

t()

@type t() :: %Spek.EvaluationError{
  __exception__: term(),
  expression: Spek.expression() | nil,
  message: String.t()
}

Struct returned or raised if an authorization check fails.

expression contains the parts of the policy expression that were performed and their results. Depending on the evaluation function used, this may be the complete expression, or only the parts of it that were evaluated until a decision was made.

Functions

new(message \\ "rule evaluation failed")

@spec new(String.t()) :: t()

Returns a new EvaluationError struct.

with_expression(message \\ "rule evaluation failed", expression)

@spec with_expression(String.t(), Spek.expression()) :: t()

Returns a new EvaluationError struct that contains the given expression.