Ash.Error.Framework.InvalidReturnType exception (ash v3.24.3)

Copy Markdown View Source

This error is raised when a behaviour implementation returns a value that does not match the behaviour's callback return type.

The message field should identify the behaviour module, the callback (e.g. module.function/arity), and list the allowed return shapes so implementors can fix the return value.

Usage in behaviour wrappers

Wrappers should call the implementation and then match the result against the allowed shapes, or use Ash.BehaviourHelpers.call_and_validate_return/5. When the result does not match any allowed shape, raise this error with a message in that format (behaviour module, callback, and allowed shapes).

Summary

Functions

exception(msg)

@spec exception(opts :: Keyword.t()) :: %Ash.Error.Framework.InvalidReturnType{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  message: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.Ash.Error.Framework.InvalidReturnType without raising it.

Keys

  • :message