                     }
 
                     route.getFirstDepartRawDirection()?.delay = delay
+
+                case .failure(let networkError):
+                    if let error = networkError as? APIError<Error> {
+                        print("\(self.fileName) \(#function) error: \(error.errorDescription ?? "") Request url: \(error.request?.url?.absoluteString ?? "")")
+                        self.setDepartureTimeAndLiveElements(withRoute: route)
+                    }
                 }
-            }) { (error) in
-                print("\(self.fileName) \(#function) error: \(error.errorDescription ?? "") Request url: \(error.request?.url?.absoluteString ?? "")")
-                self.setDepartureTimeAndLiveElements(withRoute: route)
             }
         } else {
             if let route = route {

                    if isNewDelayValue {
                        JSONFileManager.shared.logDelayParemeters(timestamp: Date(), stopId: stopId, tripId: tripId)
                        JSONFileManager.shared.logURL(timestamp: Date(), urlName: "Delay requestUrl", url: Network.getDelayUrl(tripId: tripId, stopId: stopId))
                        // JSONFileManager.shared.saveJSON(json, type: .delayJSON(rowNum: self.rowNum ?? -1))
                    }

                    let departTime = direction.startTime

            let tripId = direction.tripIdentifiers?.first,
            let stopId = direction.stops.first?.id {

            Network.getDelay(tripId: tripId, stopId: stopId).performCollectingTimeline { (response) in
                switch response.result {
                case .success(let delayResponse):
                    guard (delayResponse.data != nil), let delay = delayResponse.data else {
                        self.setDepartureTimeAndLiveElements(withRoute: route)
                        return
                    }
