TypeError: Drupal\mailchimp_transactional\API::send(): Return value must be of type array, ConnectException returned

Created on 11 May 2022, over 2 years ago
Updated 10 October 2023, about 1 year ago

Problem/Motivation

The following error is thrown when the API request fails:

<em
        class="placeholder">TypeError</em>: Drupal\mailchimp_transactional\API::send(): Return value must be of type array, GuzzleHttp\Exception\ConnectException returned in
<em class="placeholder">Drupal\mailchimp_transactional\API-&gt;send()</em> (line <em class="placeholder">215</em> of <em
        class="placeholder">modules/contrib/mailchimp_transactional/src/API.php</em>).
<pre class="backtrace">Drupal\mailchimp_transactional\API-&gt;send(Array) (Line: 50)
Drupal\mailchimp_transactional_template\TemplateService-&gt;send(Array) (Line: 257)
Drupal\mailchimp_transactional\Plugin\Mail\Mail-&gt;mail(Array) (Line: 50)
Drupal\mailsystem\Adapter-&gt;mail(Array) (Line: 311)

Steps to reproduce

Send a template mail and somehow make it fail, eg. by disconnecting from the internet.

Proposed resolution

In the mailchimp/transactional library, exceptions are not thrown, but caught and returned (link). We have to change our error handling.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024