# `PhoenixKitDocumentCreator.Errors`
[🔗](https://github.com/BeamLabEU/phoenix_kit_document_creator/blob/0.2.8/lib/phoenix_kit_document_creator/errors.ex#L1)

Single translation point for every error atom the Document Creator
module emits.

Call sites return plain `{:error, :atom}` tuples — never free-text
strings — and the UI / API layer translates via `message/1` at the
boundary. This keeps error semantics testable (assert on the atom,
not on a string that might get reworded) and makes translations
consistent (every place that surfaces `:templates_folder_not_found`
renders the exact same gettext string).

Translation files live in core `phoenix_kit`; this module only calls
`gettext/1` with literal strings so `mix gettext.extract` in core
picks them up correctly. Do NOT refactor this into a lookup map —
the extractor only sees literal arguments to `gettext/1` at the
call site.

Unknown atoms fall through to `inspect/1` so the catch-all returns
a useful-if-ugly string rather than crashing.

# `error_atom`

```elixir
@type error_atom() ::
  :copy_failed
  | :create_document_failed
  | :create_folder_failed
  | :deleted_folder_not_found
  | :documents_folder_not_found
  | :file_trashed
  | :folder_not_found
  | :folder_search_failed
  | :get_file_parents_failed
  | :invalid_action
  | :invalid_file_id
  | :invalid_google_doc_id
  | :invalid_parent_folder_id
  | :list_files_failed
  | :live_folder_not_found
  | :max_depth_exceeded
  | :missing_google_doc_id
  | :missing_name
  | :move_failed
  | :no_doc_id
  | :no_thumbnail
  | :not_found
  | :pdf_export_failed
  | :sync_failed
  | :templates_folder_not_found
  | :thumbnail_fetch_failed
  | :thumbnail_link_failed
```

# `message`

```elixir
@spec message(term()) :: String.t()
```

Returns a human-readable message for an error atom, changeset, or
other value. Safe for any input — falls through to `inspect/1` for
unknown terms.

---

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