Problem/Motivation
When the CKEditor Cloud Service is unreachable (e.g. connection timeout, DNS failure), Guzzle throws a ConnectException. The sendRequest() method in ApiAdapter catches GuzzleException (the common interface) and calls $e->getResponse() on it. However, ConnectException does not implement getResponse() — only RequestException does. This causes a fatal PHP Error that crashes the node edit form validation for logged-in editors.
Stack trace:
Error: Call to undefined method GuzzleHttp\Exception\ConnectException::getResponse()
in ckeditor5_premium_features/src/Utility/ApiAdapter.php
Steps to reproduce
Install and configure ckeditor5_premium_features with realtime collaboration.
Make the CKEditor Cloud Service unreachable (e.g. block the API endpoint or use an invalid API URL).
Open a node edit form that uses the configured text format.
Submit the form — a fatal PHP Error is thrown during form validation.
Proposed resolution
Split the single catch (GuzzleException $e) block into three separate catch blocks:
- ConnectException — handle without calling getResponse() (the method does not exist on this class)
- RequestException — safe to call getResponse() here
- GuzzleException — generic fallback for any other Guzzle error
A patch is attached.
Remaining tasks
Review and apply the patch
Add test coverage for ConnectException handling
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| ckeditor5_premium_features-connect-exception-getresponse.patch | 1.49 KB | lohndaniel |
Issue fork ckeditor5_premium_features-3592243
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lohndaniel commentedComment #3
mdusza commentedHi lohndaniel, thanks for reporting the issue - we'll look into this.
Comment #6
salmonek commentedThank you lohndaniel for the report and fix.
We have additional ApiAdapter for AI module, I applied the fix for both adapters.
Comment #7
salmonek commentedReleased in 1.8.3