From 89035bf84e48eeb17ae73a8aaa3529c66cf54550 Mon Sep 17 00:00:00 2001 From: danbugs Date: Sat, 17 Feb 2024 18:52:32 -0800 Subject: [PATCH 1/2] Bringing back 429 condition Signed-off-by: danbugs --- lib/src/common.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/common.rs b/lib/src/common.rs index 740f59a..3612904 100644 --- a/lib/src/common.rs +++ b/lib/src/common.rs @@ -85,8 +85,9 @@ where break 'inner; } Err(e) => { - if e.to_string() - .contains("Our services aren't available right now") + if e.to_string().contains("The response is [429]") + || e.to_string() + .contains("Our services aren't available right now") || e.to_string().contains("error sending request for url") { // 429 (too many reqs) or outage, want to wait it out @@ -139,7 +140,7 @@ where continue; } else { // quit program, we have an error that we can't recover from - panic!("🤔 got 'Failed to parse' at page {}!", curr_page); + panic!("🚨 quitting program due to an error we can't recover from..."); } } else { maybe_sgv = maybe_sgv.update(); From 4095b6bc8575ffdb9fb619b378366c030ff868ec Mon Sep 17 00:00:00 2001 From: danbugs Date: Sat, 17 Feb 2024 19:08:04 -0800 Subject: [PATCH 2/2] fmt Signed-off-by: danbugs --- lib/src/common.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/common.rs b/lib/src/common.rs index 3612904..dfda296 100644 --- a/lib/src/common.rs +++ b/lib/src/common.rs @@ -140,7 +140,9 @@ where continue; } else { // quit program, we have an error that we can't recover from - panic!("🚨 quitting program due to an error we can't recover from..."); + panic!( + "🚨 quitting program due to an error we can't recover from..." + ); } } else { maybe_sgv = maybe_sgv.update();