mirror of
https://github.com/appwrite/appwrite
synced 2026-05-11 03:00:51 +00:00
\Exception doesn't work as a catch-all because not everything extends
\Exception. For example, there was a problem where the messaging worker
didn't catch an exception here:
} catch (\Exception $e) {
$deliveryErrors[] = 'Failed sending to targets ' . $batchIndex + 1 . '-' . \count($batch) . ' with error: ' . $e->getMessage();
} finally {
As such, $deliveryErrors stayed as an empty array. In this case, the
$adapter->send() threw a TypeError which extends Error which implements
Throwable. Updating the catch to catch \Throwable ensures the error is
caught and $deliveryErrors gets updated.
|
||
|---|---|---|
| .. | ||
| account.php | ||
| avatars.php | ||
| console.php | ||
| databases.php | ||
| functions.php | ||
| graphql.php | ||
| health.php | ||
| locale.php | ||
| messaging.php | ||
| migrations.php | ||
| project.php | ||
| projects.php | ||
| proxy.php | ||
| storage.php | ||
| teams.php | ||
| users.php | ||
| vcs.php | ||