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

feat(proguard): Retry upload-proguard on 507 status #2141

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/api/errors/api_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub(in crate::api) enum ApiErrorKind {
"DSN missing. Please set the `SENTRY_DSN` environment variable to your project's DSN."
)]
DsnMissing,
#[error("Error preparing request")]
ErrorPreparingRequest,
}

impl fmt::Display for ApiError {
Expand Down
9 changes: 9 additions & 0 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,15 @@ impl<'a> RegionSpecificApi<'a> {
form.part("file").file(file).add()?;
self.request(Method::Post, &path)?
.with_form_data(form)?
.with_retry(
self.api.api.config.get_max_retry_count().map_err(|e| {
ApiError::with_source(
ApiErrorKind::ErrorPreparingRequest,
e.context("Could not parse retry count"),
)
})?,
&[http::HTTP_STATUS_507_INSUFFICIENT_STORAGE],
)?
.progress_bar_mode(ProgressBarMode::Request)?
.send()?
.convert()
Expand Down
1 change: 1 addition & 0 deletions src/utils/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use regex::Regex;
pub const HTTP_STATUS_502_BAD_GATEWAY: u32 = 502;
pub const HTTP_STATUS_503_SERVICE_UNAVAILABLE: u32 = 503;
pub const HTTP_STATUS_504_GATEWAY_TIMEOUT: u32 = 504;
pub const HTTP_STATUS_507_INSUFFICIENT_STORAGE: u32 = 507;

lazy_static! {
static ref LINK_TOKEN_RE: Regex = Regex::new(
Expand Down
Loading