Skip to content

Commit

Permalink
Merge pull request #456 from answerbook/mdeltito/LOG-19799
Browse files Browse the repository at this point in the history
fix(http): handle and report partial failures with 207 status
  • Loading branch information
mdeltito committed May 1, 2024
2 parents 0c91263 + 744386a commit 0d680df
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/sinks/util/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,26 @@ where

impl UserLoggingResponse for HttpResponse {
fn log_msg(&self) -> Option<Value> {
if !self.http_response.status().is_success() {
let status = self.http_response.status();
if status.is_success() {
match status {
StatusCode::MULTI_STATUS => Some(
format!(
"Partial error returned from destination with status code: {}",
status
)
.into(),
),
_ => None,
}
} else {
Some(
format!(
"Error returned from destination with status code: {}",
self.http_response.status()
status
)
.into(),
)
} else {
None
}
}

Expand Down

0 comments on commit 0d680df

Please sign in to comment.