Jido.AI.Error.Sanitize (Jido AI v2.2.0)

Copy Markdown View Source

Sanitization helpers for user-safe error messaging.

Summary

Functions

Returns both user-facing and log-facing error representations.

Produces a user-safe error message from any error term.

Functions

sanitize_error_for_display(error)

@spec sanitize_error_for_display(term()) :: %{
  user_message: String.t(),
  log_message: String.t()
}

Returns both user-facing and log-facing error representations.

sanitize_error_message(error, opts \\ [])

@spec sanitize_error_message(
  term(),
  keyword()
) :: String.t()

Produces a user-safe error message from any error term.