Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch Throwable and let the exception converter handle details #896

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Firebase/Messaging.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Kreait\Firebase;

use Beste\Json;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise\Utils;
use Kreait\Firebase\Exception\InvalidArgumentException;
use Kreait\Firebase\Exception\Messaging\InvalidArgument;
Expand Down Expand Up @@ -97,7 +96,7 @@

$sendReports[$index] = SendReport::success($message->target(), $json, $message);
},
'rejected' => function (RequestException $reason, int $index) use ($messages, &$sendReports) {
'rejected' => function (Throwable $reason, int $index) use ($messages, &$sendReports) {

Check warning on line 99 in src/Firebase/Messaging.php

View check run for this annotation

Codecov / codecov/patch

src/Firebase/Messaging.php#L99

Added line #L99 was not covered by tests
$message = $messages[$index];

$error = $this->exceptionConverter->convertException($reason);
Expand Down