feat: improved exception handling

This commit is contained in:
Björn Fromme
2025-03-27 09:56:00 +01:00
parent 485d37518f
commit 589787f024
7 changed files with 50 additions and 51 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ namespace App\Controller\Booking;
use App\BusProNet\ApiClient;
use App\BusProNet\Exception\ApiClientException;
use App\BusProNet\Exception\ResponseParserException;
use App\BusProNet\Model\BaseData;
use App\BusProNet\XmlLoader\TravelLoader;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@@ -35,7 +34,7 @@ class IndexController extends AbstractController
try {
$bookings = $this->apiClient->getBookings($bpnUser->getEmail(), $bpnUser->getPassword());
} catch (ApiClientException|ResponseParserException $e) {
} catch (ApiClientException $e) {
$this->addFlash('error', 'Buchungen nicht abrufbar');
$bookings = new BaseData([]);
}