From f940d2d92c1a7d3b6e5be11f4a8ca289f5828de4 Mon Sep 17 00:00:00 2001 From: Fabian Vogler Date: Thu, 10 Oct 2024 20:30:36 +0200 Subject: [PATCH] Catch messages from timetable.search.ch --- lib/Transport/API.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Transport/API.php b/lib/Transport/API.php index 4eae642..6e9c555 100644 --- a/lib/Transport/API.php +++ b/lib/Transport/API.php @@ -170,6 +170,11 @@ public function getStationBoard(StationBoardQuery $query) // send request $result = $this->sendAndParseQuery($query); + // check for API messages + if (isset($result->messages) && is_array($result->messages)) { + throw new \Exception('Messages from timetable.search.ch: '.implode($result->messages)); + } + $station = Station::createStationFromJson($result->stop); $journeys = [];