Skip to content

Commit

Permalink
Add key value to deserialize errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Oct 17, 2024
1 parent 9e78aaa commit 3635577
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion crates/directory/src/backend/internal/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ impl DirectoryStore for Store {
Ok(true)
},
)
.await.caused_by(trc::location!())?;
.await
.caused_by(trc::location!())?;
}

Ok(results)
Expand Down
4 changes: 3 additions & 1 deletion crates/jmap/src/api/management/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ impl QueueManagement for Server {
.iterate(
IterateParams::new(from_key, to_key).ascending(),
|key, value| {
let message = Bincode::<queue::Message>::deserialize(value)?.inner;
let message = Bincode::<queue::Message>::deserialize(value)
.add_context(|ctx| ctx.ctx(trc::Key::Key, key))?
.inner;
let matches = tenant_domains
.as_ref()
.map_or(true, |domains| message.has_domain(domains))
Expand Down
3 changes: 2 additions & 1 deletion crates/jmap/src/api/management/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ impl ManageReports for Server {
Ok(max_total == 0 || total < max_total)
},
)
.await.caused_by(trc::location!())?;
.await
.caused_by(trc::location!())?;

Ok(JsonResponse::new(json!({
"data": {
Expand Down
4 changes: 3 additions & 1 deletion crates/jmap/src/services/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ impl Indexer for Server {
)
.await
.map_err(|err| {
trc::error!(err.caused_by(trc::location!()).details("Failed to iterate over index emails"));
trc::error!(err
.caused_by(trc::location!())
.details("Failed to iterate over index emails"));
});

// Add entries to the index
Expand Down
3 changes: 2 additions & 1 deletion crates/smtp/src/reporting/dmarc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ impl DmarcReporting for Server {
}
},
)
.await.caused_by(trc::location!())?;
.await
.caused_by(trc::location!())?;

for (record, count) in record_map {
report = report.with_record(record.with_count(count));
Expand Down
3 changes: 2 additions & 1 deletion crates/smtp/src/reporting/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ impl TlsReporting for Server {
Ok(true)
}
})
.await.caused_by(trc::location!())?;
.await
.caused_by(trc::location!())?;

// Add policy
report.policies.push(Policy {
Expand Down

0 comments on commit 3635577

Please sign in to comment.