Skip to content

Commit

Permalink
fix: add handling for GuzzleHttp RequestException in getData method
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPunyapal committed Dec 12, 2024
1 parent 652b3e2 commit f21d1fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Services/MetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Services;

use DOMDocument;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
Expand Down Expand Up @@ -99,6 +100,8 @@ private function getData(): Collection
}
} catch (ConnectionException) {
// Catch but not capture the exception
} catch (RequestException) {
// Catch but not capture the exception
}

return $data;
Expand Down

0 comments on commit f21d1fe

Please sign in to comment.