Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bringing back 429 condition #97

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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")

Check warning on line 90 in lib/src/common.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/common.rs#L88-L90

Added lines #L88 - L90 were not covered by tests
|| 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 @@
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..."
);

Check warning on line 145 in lib/src/common.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/common.rs#L143-L145

Added lines #L143 - L145 were not covered by tests
}
} else {
maybe_sgv = maybe_sgv.update();
Expand Down
Loading