Uncaught ServerException when Smartcat API returns 500 – request should fail gracefully

Created on 26 June 2025, 10 days ago

Problem/Motivation

The module does not handle GuzzleHttp\Exception\ServerException when the external API returns a 500 Internal Server Error.

This results in a fatal uncaught exception and breaks processes (such as batch), instead of logging the issue and continuing gracefully.

Actual behavior

Uncaught exception crashes the current request

[23-Jun-2025 15:29:38 UTC] Uncaught PHP Exception GuzzleHttp\Exception\ServerException:
"Server error: `POST https://ihub-us.smartcat.com/api/drupal/project` resulted in a `500 Internal Server Error` response:
{"ErrorCode":null,"Message":"Error processing request. Correlation id: a487e1c4-3abb-4df4-84c8-19f271f62544"}
" at /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php line 111

Expected behavior

Fail gracefully, log the problem, and let the process continue.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine trolya

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

Comments & Activities

Production build 0.71.5 2024