Maps a caught error to a safe, localized string suitable for rendering to
end users.
Transport-level exceptions embed technical detail in their message
(timeouts, URLs, parse failures) and are replaced by localized common
strings. Every other error — including UnexpectedStatusException, which
no longer carries the raw response body in its message — falls back to
the caller's surface-specific localized string (e.g.
strings.comments.postFailed), so raw server payloads and English-only
internals never bypass i18n on screen.
Host developers retain full diagnostics on the error object itself
(err.message, err.status, err.responseBody).
Parameters
err: unknown
The caught error (unknown-safe).
fallback: string
Localized fallback string for the failing surface.
Maps a caught error to a safe, localized string suitable for rendering to end users.
Transport-level exceptions embed technical detail in their
message(timeouts, URLs, parse failures) and are replaced by localizedcommonstrings. Every other error — includingUnexpectedStatusException, which no longer carries the raw response body in itsmessage— falls back to the caller's surface-specific localized string (e.g.strings.comments.postFailed), so raw server payloads and English-only internals never bypass i18n on screen.Host developers retain full diagnostics on the error object itself (
err.message,err.status,err.responseBody).