Skip to content

Commit

Permalink
Bringing back 429 condition (#97)
Browse files Browse the repository at this point in the history
* Bringing back 429 condition

Signed-off-by: danbugs <[email protected]>

* fmt

Signed-off-by: danbugs <[email protected]>

---------

Signed-off-by: danbugs <[email protected]>
  • Loading branch information
danbugs authored Feb 18, 2024
1 parent 0be1f9f commit c5bc1fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit c5bc1fd

Please sign in to comment.