Add key value to deserialize errors
Some checks failed
trivy / Check (push) Failing after 9s

This commit is contained in:
mdecimus 2024-10-17 17:41:48 +02:00
parent 9e78aaa751
commit 3635577706
6 changed files with 14 additions and 6 deletions

View file

@ -135,7 +135,8 @@ impl DirectoryStore for Store {
Ok(true) Ok(true)
}, },
) )
.await.caused_by(trc::location!())?; .await
.caused_by(trc::location!())?;
} }
Ok(results) Ok(results)

View file

@ -206,7 +206,9 @@ impl QueueManagement for Server {
.iterate( .iterate(
IterateParams::new(from_key, to_key).ascending(), IterateParams::new(from_key, to_key).ascending(),
|key, value| { |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 let matches = tenant_domains
.as_ref() .as_ref()
.map_or(true, |domains| message.has_domain(domains)) .map_or(true, |domains| message.has_domain(domains))

View file

@ -227,7 +227,8 @@ impl ManageReports for Server {
Ok(max_total == 0 || total < max_total) Ok(max_total == 0 || total < max_total)
}, },
) )
.await.caused_by(trc::location!())?; .await
.caused_by(trc::location!())?;
Ok(JsonResponse::new(json!({ Ok(JsonResponse::new(json!({
"data": { "data": {

View file

@ -118,7 +118,9 @@ impl Indexer for Server {
) )
.await .await
.map_err(|err| { .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 // Add entries to the index

View file

@ -559,7 +559,8 @@ impl DmarcReporting for Server {
} }
}, },
) )
.await.caused_by(trc::location!())?; .await
.caused_by(trc::location!())?;
for (record, count) in record_map { for (record, count) in record_map {
report = report.with_record(record.with_count(count)); report = report.with_record(record.with_count(count));

View file

@ -366,7 +366,8 @@ impl TlsReporting for Server {
Ok(true) Ok(true)
} }
}) })
.await.caused_by(trc::location!())?; .await
.caused_by(trc::location!())?;
// Add policy // Add policy
report.policies.push(Policy { report.policies.push(Policy {