From c5bc1fd4fa7efed6bb64b9f4e07f79c7fbcc3307 Mon Sep 17 00:00:00 2001 From: Dan Chiarlone Date: Sat, 17 Feb 2024 19:36:05 -0800 Subject: [PATCH] Bringing back 429 condition (#97) * Bringing back 429 condition Signed-off-by: danbugs * fmt Signed-off-by: danbugs --------- Signed-off-by: danbugs --- lib/src/common.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/common.rs b/lib/src/common.rs index 740f59a..dfda296 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,9 @@ 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();