Skip to content

fix(lang): skip failed translation fields on API errors (#2303)#2784

Open
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/issue-2303-translation-server-error
Open

fix(lang): skip failed translation fields on API errors (#2303)#2784
Tarekchehahde wants to merge 1 commit into
IFRCGo:developfrom
Tarekchehahde:fix/issue-2303-translation-server-error

Conversation

@Tarekchehahde

Copy link
Copy Markdown

Summary

  • On IFRC translation HTTP errors (including 500), log text_length and return None instead of attempting JSON parse
  • Wrap Amazon Translate calls similarly so a single field failure does not abort other languages
  • ModelTranslator already skips None translations per field

Test plan

  • Unit test: IFRC 500 response returns None
  • Verify Sentry logs include text_length extra on production errors

Fixes #2303

Made with Cursor

Return None and log text length when IFRC or Amazon translation fails so
only the affected field/language is skipped, not the whole object.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Tarekchehahde

Copy link
Copy Markdown
Author

Follow-up: #2790 adds recursive HTML chunking for ~50k+ fields (same #2303). Happy to close #2784 in favor of #2790 or keep both if you prefer the smaller error-handling-only change first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle translation server error

1 participant