mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 15:15:01 +00:00
* Improve chat LLM error messages * Fix chat visibility regression in tests * Harden chat error handling for review feedback * Fix rubocop private method indentation * Fix nil presentable_error_message, i18n strings, bare rescue - Guard `presentable_error_message` with `return nil if error.blank?` so chats with no error return nil instead of the fallback string; this prevents the API serialisers from emitting a spurious error message and stops the mobile polling guard from firing on every successful chat - Move all hardcoded user-facing error strings into config/locales/models/chat/en.yml and reference them via I18n.t() - Replace bare `rescue` in `error_message_for` with `rescue StandardError` to avoid swallowing system-level exceptions - Update tests to reference I18n keys instead of raw strings, and add tests for the nil-error case and the unrecognized-error fallback https://claude.ai/code/session_01YFMjEds5WVyKPL42xBqMCX --------- Co-authored-by: SureBot <sure-bot@we-promise.com> Co-authored-by: Claude <noreply@anthropic.com>
9 lines
419 B
YAML
9 lines
419 B
YAML
---
|
|
en:
|
|
chat:
|
|
errors:
|
|
rate_limited: "The AI provider is rate limited right now. Please try again in a few minutes."
|
|
temporarily_unavailable: "The AI provider is temporarily unavailable right now. Please try again in a few minutes."
|
|
misconfigured: "The AI provider is not configured correctly. Please contact your administrator."
|
|
default: "Failed to generate a response. Please try again."
|