PhoenixKitStats.Errors (PhoenixKitStats v0.2.1)

Copy Markdown View Source

Central mapping from error atoms (returned by PhoenixKitStats.Groups and used across its LiveViews) to translated human-readable strings.

Supported reason shapes

  • plain atoms — :group_not_found, :port_taken, etc.
  • strings — passed through unchanged
  • anything else — rendered as "Unexpected error: <inspect>"

Example

iex> PhoenixKitStats.Errors.message(:group_not_found)
"Stats group not found."

Summary

Functions

Translates an error reason into a user-facing string via gettext.

Functions

message(reason)

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

Translates an error reason into a user-facing string via gettext.