I’m trying to catch all possible exceptions in code below.
The question is, are there any exception types that this code does not handle?
/*
*
* This is just an EXAMPLE code
*
*/
use AppModelsUser;
use IlluminateHttpClientPool;
use IlluminateSupportFacadesHttp;
$users = User::all();
$website = "https://www.google.com/";
Http::pool(function (Pool $pool) use ($users, $website) {
$users->each(function ($user) use ($pool, $website) {
$pool->retry(1)
->timeout(60)
->get($website)
->then(function ($response) use ($user) {
// On Fulfilled
$status =
!(($response instanceof Exception || $response->getStatusCode() !== 200));
$user->status = $status;
$user->save();
});
});
});