From 094fb6cd70007d2d469c2cf699cf33ca292e39dc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 30 Aug 2023 11:38:36 +0200 Subject: [PATCH] Fix support for react/promise 2.x --- src/Composer/Util/HttpDownloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/HttpDownloader.php b/src/Composer/Util/HttpDownloader.php index e4b26d24b..723ff0287 100644 --- a/src/Composer/Util/HttpDownloader.php +++ b/src/Composer/Util/HttpDownloader.php @@ -108,7 +108,7 @@ class HttpDownloader throw new \InvalidArgumentException('$url must not be an empty string'); } [$job, $promise] = $this->addJob(['url' => $url, 'options' => $options, 'copyTo' => null], true); - $promise->catch(function (\Throwable $e) { + $promise->then(null, function (\Throwable $e) { // suppress error as it is rethrown to the caller by getResponse() a few lines below }); $this->wait($job['id']);