getUser(); $email = $user->getEmail(); $password = $this->crypt->decrypt($user->getPassword()); try { $bookings = $this->apiClient->getBookings($email, $password); } catch (ApiClientException $e) { $this->addFlash('error', 'Buchungen nicht abrufbar'); $bookings = new BaseData([]); } if ($bookings instanceof Notification) { $this->logger->error('Unable to fetch bookings data', [ 'email' => $email, 'code' => $bookings->code, 'error' => $bookings->message, ]); $this->addFlash('error', 'Buchungen nicht abrufbar'); $bookings = new BaseData([]); } $this->travelDataLoader->patchBookings($bookings); return $this->render('booking/index.html.twig', [ 'bookings' => $bookings->getItems(), ]); } }