Skip to content

Commit

Permalink
[identity] improve error log for failed backup deletion
Browse files Browse the repository at this point in the history
Summary:
We've noticed that sometimes the response body is empty. Improving this error log to hopefully uncover some more information if we see another backup deletion call fail with no response body

Depends on D13498

Test Plan: disabled local backup service and confirmed that the HTTP response code appears in log

Reviewers: bartek, will

Reviewed By: bartek

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13499
  • Loading branch information
vdhanan committed Sep 27, 2024
1 parent a206fda commit 5832c66
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions services/identity/src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ pub async fn delete_backup_user_data(
.send()
.await?;
if !response.status().is_success() {
let response_body = response.text().await?;
let response_status = response.status();
let response_body = response
.text()
.await
.unwrap_or("[failed to get response text]".to_string());
tracing::error!(
errorType = error_types::HTTP_LOG,
"Backup service failed to delete user data: {}",
response_body
"Backup service failed to delete user data: {} - {}",
response_status,
response_body,
)
}
Ok(())
Expand Down

0 comments on commit 5832c66

Please sign in to comment.