AshLua.Errors.FieldsError exception (ash_lua v0.2.3)

Copy Markdown View Source

An error raised during field-selection parsing / validation, carrying the user-facing message, stable code, and any field names + interpolation context the throw site knew about.

The AshLua.Error protocol impl unwraps this directly to the standard error shape — no central switch over internal tags.

This is a Splode error of class :invalid, so it can be attached to an Ash.Query with Ash.Query.add_error/3 and Ash will keep it as an invalid input error instead of wrapping it as unknown.

Summary

Types

t()

@type t() :: %AshLua.Errors.FieldsError{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  code: String.t(),
  fields: [String.t()],
  message: String.t(),
  path: term(),
  short_message: String.t(),
  splode: term(),
  stacktrace: term(),
  vars: map() | Keyword.t()
}

Functions

exception(msg)

@spec exception(opts :: Keyword.t()) :: %AshLua.Errors.FieldsError{
  __exception__: term(),
  bread_crumbs: term(),
  class: term(),
  code: term(),
  fields: term(),
  message: term(),
  path: term(),
  short_message: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.AshLua.Errors.FieldsError without raising it.

Keys

  • :message
  • :short_message
  • :code
  • :fields