Problem/Motivation

When the remote URL configured in `site_audit_send` is unreachable, a fatal PHP error is thrown:

Error: Call to undefined method GuzzleHttp\Exception\ConnectException::hasResponse()
in /docroot/modules/contrib/site_audit/site_audit_send/src/RestClient.php on line 118

Steps to reproduce

1. Install and enable `site_audit_send`.
2. Configure an unreachable or invalid remote URL under the module settings.
3. Trigger a report send (or use the test URL feature).
4. Observe the fatal error.

Proposed resolution

Add an `instanceof RequestException` guard before calling `hasResponse()` in both catch blocks inside `RestClient.php`.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork site_audit-3583041

Command icon 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

froboy created an issue. See original summary.

  • froboy committed 8cf39279 on 4.x
    [#3583041] Fix `ConnectException::hasResponse()` fatal error when remote...
froboy’s picture

Status: Active » Needs review
froboy’s picture

Version: 4.x-dev » 4.1.3
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.