# `AshGettext.Resource.Transformers.AttachErrorHandler`
[🔗](https://github.com/Undeadlol1/ash_gettext/blob/v0.1.0/lib/ash_gettext/resource/transformers/attach_error_handler.ex#L1)

Point every write action's `error_handler` at `AshGettext.ErrorTranslation.ErrorHandler`.

Doing this at compile time is what makes translation a property of the resource
rather than a thing each action has to remember. Adding an action to a resource
that uses `AshGettext.Resource` cannot forget to translate.

Two deliberate limits:

* **Write actions only.** Ash 3.29 exposes `error_handler` on `create`,
  `update` and `destroy` — the changeset-based actions. Read and generic
  actions have no equivalent hook, so their errors are not translated here.
* **An action that already declares an `error_handler` is left alone.** The
  app asked for that handler explicitly; silently replacing it would be a worse
  surprise than an untranslated message.

# `after_compile?`

# `before?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
