Improve error handling for failed translation API requests

Created on 20 August 2025, 2 months ago

Problem/Motivation

When a translation API request fails (for example, with a 403 response), the translation process stops and logs an error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null
This is misleading because the actual problem is with the failed API call, not the database schema.

Steps to reproduce

1. Simulate an API failure (e.g., return a 403 response).
2. Check the logs.
3. Notice that a database error (Column 'title' cannot be null) is logged instead of a clear API failure message.

Proposed resolution

In the catch block, throw a TranslationException instead of returning an empty TranslateTextOutput. This will make the root cause (API failure) clearer and prevent misleading database errors.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇪Georgia IliaNoz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024