From 6fbdc6193ccc538b67719f82ec8505c963cec626 Mon Sep 17 00:00:00 2001 From: jane400 Date: Tue, 17 Sep 2024 19:23:12 +0200 Subject: [PATCH] feat: add extra warning if shipment api breaks --- paket/src/ready.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/paket/src/ready.rs b/paket/src/ready.rs index db424fb..be2260d 100644 --- a/paket/src/ready.rs +++ b/paket/src/ready.rs @@ -342,10 +342,15 @@ impl Component for Ready { } } Err(err) => { - sender.output(ReadyOutput::Error(err)).unwrap(); + if err == LibraryError::APIChange { + println!("Upstream API for parcel tracking broke"); + sender.input(ReadyInput::ServiceBorked(Services::SendungVerfolgung)); + sender.output(ReadyOutput::Notification("Shipment Tracking API has changed. Deactivating that service.".to_string())).unwrap(); + } else { + sender.output(ReadyOutput::Error(err)).unwrap(); + } } }, } } } -