Skip to content

Commit a728f98

Browse files
authored
Merge pull request #68 from ddbnl/master
Improve debug logs
2 parents c656b54 + be77904 commit a728f98

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

Release/Linux/OfficeAuditLogCollector

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:9b4d3320c7e109dbe6ed1f380ae16230f6ca8b9b005d815bdb44aeffc0f4e454
3-
size 7349496
2+
oid sha256:2d36dc1c760f7ed5c7c846f61826b78f7d740aaec7a7048b2d56749b1ef3c7d1
3+
size 7349416
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:69580b148a6b7ee23881a8562998028bdb113c6ec85c19f2cd9911ba7a3da4fc
3-
size 6075904
2+
oid sha256:e9b0e2c7f4eabfb0b4185ece0cee5400bece88f40f4b602e096f4bd5ae38a751
3+
size 6064128

src/api_connection.rs

+25-8
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,33 @@ async fn handle_blob_response(
259259
mut blob_error_tx: Sender<(String, String)>, content_type: String, url: String,
260260
known_blobs: &HashMap<String, String>, duplicate: usize) {
261261

262-
handle_blob_response_paging(&resp, blobs_tx, status_tx.clone(),
263-
content_type.clone()).await;
264-
match resp.json::<Vec<HashMap<String, Value>>>().await {
265-
Ok(i) => {
266-
handle_blob_response_content_uris(status_tx, content_tx, content_type, i, known_blobs,
267-
duplicate)
268-
.await;
262+
handle_blob_response_paging(&resp, blobs_tx, status_tx.clone(), content_type.clone()).await;
263+
264+
match resp.text().await {
265+
Ok(text) => {
266+
match serde_json::from_str::<Vec<HashMap<String, Value>>>(text.as_str()) {
267+
Ok(i) => {
268+
handle_blob_response_content_uris(status_tx, content_tx, content_type, i, known_blobs,
269+
duplicate)
270+
.await;
271+
},
272+
Err(e) => {
273+
warn!("Error getting blob JSON {}", e);
274+
debug!("Errored blob json content: {}", text);
275+
match blob_error_tx.send((content_type, url)).await {
276+
Err(e) => {
277+
error!("Could not resend failed blob, dropping it: {}", e);
278+
status_tx.send(StatusMessage::ErrorContentBlob).await.unwrap_or_else(
279+
|e| panic!("Could not send status update, channel closed?: {}", e)
280+
);
281+
},
282+
_=> (),
283+
}
284+
}
285+
}
269286
},
270287
Err(e) => {
271-
warn!("Error getting blob JSON {}", e);
288+
warn!("Error getting blob response text {}", e);
272289
match blob_error_tx.send((content_type, url)).await {
273290
Err(e) => {
274291
error!("Could not resend failed blob, dropping it: {}", e);

0 commit comments

Comments
 (0)