diff --git a/src/chat.rs b/src/chat.rs index 4de92e070..8a5ee0bb2 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1129,7 +1129,7 @@ impl Chat { } } Err(err) => { - error!(context, "faild to load contacts for {}: {:?}", chat.id, err); + error!(context, "faild to load contacts for {}: {:#}", chat.id, err); } } chat.name = chat_name; @@ -2146,7 +2146,7 @@ async fn create_send_msg_job(context: &Context, msg_id: MsgId) -> Result attach_selfavatar, Err(err) => { - warn!(context, "job: cannot get selfavatar-state: {}", err); + warn!(context, "job: cannot get selfavatar-state: {:#}", err); false } }; @@ -2208,27 +2208,27 @@ async fn create_send_msg_job(context: &Context, msg_id: MsgId) -> Result error!(self, "Failed to start IO: {}", err), + Err(err) => error!(self, "Failed to start IO: {:#}", err), Ok(scheduler) => *lock = Some(scheduler), } } @@ -499,7 +499,7 @@ impl Context { match &*s { RunningState::Running { cancel_sender } => { if let Err(err) = cancel_sender.send(()).await { - warn!(self, "could not cancel ongoing: {:?}", err); + warn!(self, "could not cancel ongoing: {:#}", err); } info!(self, "Signaling the ongoing process to stop ASAP.",); *s = RunningState::ShallStop; diff --git a/src/download.rs b/src/download.rs index de127c7ae..015eb56f1 100644 --- a/src/download.rs +++ b/src/download.rs @@ -132,7 +132,7 @@ impl Job { /// Called in response to `Action::DownloadMsg`. pub(crate) async fn download_msg(&self, context: &Context, imap: &mut Imap) -> Status { if let Err(err) = imap.prepare(context).await { - warn!(context, "download: could not connect: {:?}", err); + warn!(context, "download: could not connect: {:#}", err); return Status::RetryNow; } diff --git a/src/html.rs b/src/html.rs index ac59793fc..279995292 100644 --- a/src/html.rs +++ b/src/html.rs @@ -250,7 +250,7 @@ impl MsgId { if !rawmime.is_empty() { match HtmlMsgParser::from_bytes(context, &rawmime).await { Err(err) => { - warn!(context, "get_html: parser error: {}", err); + warn!(context, "get_html: parser error: {:#}", err); Ok(None) } Ok(parser) => Ok(Some(parser.html)), diff --git a/src/job.rs b/src/job.rs index e3b513fed..689a7cade 100644 --- a/src/job.rs +++ b/src/job.rs @@ -157,7 +157,7 @@ impl Job { /// Synchronizes UIDs for all folders. async fn resync_folders(&mut self, context: &Context, imap: &mut Imap) -> Status { if let Err(err) = imap.prepare(context).await { - warn!(context, "could not connect: {:?}", err); + warn!(context, "could not connect: {:#}", err); return Status::RetryLater; } @@ -246,7 +246,7 @@ pub(crate) async fn perform_job(context: &Context, mut connection: Connection<'_ time_offset ); job.save(context).await.unwrap_or_else(|err| { - error!(context, "failed to save job: {}", err); + error!(context, "failed to save job: {:#}", err); }); } else { info!( @@ -254,7 +254,7 @@ pub(crate) async fn perform_job(context: &Context, mut connection: Connection<'_ "remove job {} as it exhausted {} retries", job, JOB_RETRIES ); job.delete(context).await.unwrap_or_else(|err| { - error!(context, "failed to delete job: {}", err); + error!(context, "failed to delete job: {:#}", err); }); } } @@ -269,7 +269,7 @@ pub(crate) async fn perform_job(context: &Context, mut connection: Connection<'_ } job.delete(context).await.unwrap_or_else(|err| { - error!(context, "failed to delete job: {}", err); + error!(context, "failed to delete job: {:#}", err); }); } } @@ -403,7 +403,7 @@ LIMIT 1; Ok(job) => return Ok(job), Err(err) => { // Remove invalid job from the DB - info!(context, "cleaning up job, because of {}", err); + info!(context, "cleaning up job, because of {:#}", err); // TODO: improve by only doing a single query let id = context diff --git a/src/location.rs b/src/location.rs index bff558912..dc6bf3af6 100644 --- a/src/location.rs +++ b/src/location.rs @@ -337,7 +337,7 @@ pub async fn set(context: &Context, latitude: f64, longitude: f64, accuracy: f64 ContactId::SELF, ] ).await { - warn!(context, "failed to store location {:?}", err); + warn!(context, "failed to store location {:#}", err); } else { info!(context, "stored location for chat {}", chat_id); continue_streaming = true; @@ -638,7 +638,7 @@ pub(crate) async fn location_loop(context: &Context, interrupt_receiver: Receive loop { let next_event = match maybe_send_locations(context).await { Err(err) => { - warn!(context, "maybe_send_locations failed: {}", err); + warn!(context, "maybe_send_locations failed: {:#}", err); Some(60) // Retry one minute later. } Ok(next_event) => next_event, diff --git a/src/message.rs b/src/message.rs index d05b8b366..e8cc3a936 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1687,7 +1687,7 @@ pub async fn get_unblocked_msg_cnt(context: &Context) -> usize { { Ok(res) => res, Err(err) => { - error!(context, "get_unblocked_msg_cnt() failed. {}", err); + error!(context, "get_unblocked_msg_cnt() failed. {:#}", err); 0 } } @@ -1707,7 +1707,7 @@ pub async fn get_request_msg_cnt(context: &Context) -> usize { { Ok(res) => res, Err(err) => { - error!(context, "get_request_msg_cnt() failed. {}", err); + error!(context, "get_request_msg_cnt() failed. {:#}", err); 0 } } diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 843053930..e7a2ea40e 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -251,7 +251,7 @@ impl MimeMessage { } Ok(None) => (Ok(mail), HashSet::new(), false), Err(err) => { - warn!(context, "decryption failed: {}", err); + warn!(context, "decryption failed: {:#}", err); (Err(err), HashSet::new(), false) } }; @@ -380,7 +380,7 @@ impl MimeMessage { typ: Viewtype::Text, msg_raw: Some(txt.clone()), msg: txt, - error: Some(format!("Decrypting failed: {}", err)), + error: Some(format!("Decrypting failed: {:#}", err)), ..Default::default() }; parser.parts.push(part); @@ -680,7 +680,7 @@ impl MimeMessage { Err(err) => { warn!( context, - "Could not save decoded avatar to blob file: {}", err + "Could not save decoded avatar to blob file: {:#}", err ); None } @@ -987,7 +987,7 @@ impl MimeMessage { let decoded_data = match mail.get_body() { Ok(decoded_data) => decoded_data, Err(err) => { - warn!(context, "Invalid body parsed {:?}", err); + warn!(context, "Invalid body parsed {:#}", err); // Note that it's not always an error - might be no data return Ok(false); } @@ -1007,7 +1007,7 @@ impl MimeMessage { let decoded_data = match mail.get_body() { Ok(decoded_data) => decoded_data, Err(err) => { - warn!(context, "Invalid body parsed {:?}", err); + warn!(context, "Invalid body parsed {:#}", err); // Note that it's not always an error - might be no data return Ok(false); } @@ -1139,7 +1139,7 @@ impl MimeMessage { if filename.starts_with("location") || filename.starts_with("message") { let parsed = location::Kml::parse(decoded_data) .map_err(|err| { - warn!(context, "failed to parse kml part: {}", err); + warn!(context, "failed to parse kml part: {:#}", err); }) .ok(); if filename.starts_with("location") { @@ -1157,7 +1157,7 @@ impl MimeMessage { self.sync_items = context .parse_sync_items(serialized) .map_err(|err| { - warn!(context, "failed to parse sync data: {}", err); + warn!(context, "failed to parse sync data: {:#}", err); }) .ok(); return Ok(()); @@ -1179,7 +1179,7 @@ impl MimeMessage { Err(err) => { error!( context, - "Could not add blob for mime part {}, error {}", filename, err + "Could not add blob for mime part {}, error {:#}", filename, err ); return Ok(()); } @@ -1224,7 +1224,7 @@ impl MimeMessage { Err(err) => { warn!( context, - "PGP key attachment is not an ASCII-armored file: {}", err, + "PGP key attachment is not an ASCII-armored file: {:#}", err ); return Ok(false); } diff --git a/src/quota.rs b/src/quota.rs index eba52899f..9b233a349 100644 --- a/src/quota.rs +++ b/src/quota.rs @@ -134,7 +134,7 @@ impl Context { /// Called in response to `Action::UpdateRecentQuota`. pub(crate) async fn update_recent_quota(&self, imap: &mut Imap) -> Result { if let Err(err) = imap.prepare(self).await { - warn!(self, "could not connect: {:?}", err); + warn!(self, "could not connect: {:#}", err); return Ok(Status::RetryNow); } @@ -162,7 +162,7 @@ impl Context { self.set_config(Config::QuotaExceeding, None).await?; } } - Err(err) => warn!(self, "cannot get highest quota usage: {:?}", err), + Err(err) => warn!(self, "cannot get highest quota usage: {:#}", err), } } diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 41bb20ff9..e8ad015af 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -102,7 +102,7 @@ pub(crate) async fn receive_imf_inner( let mut mime_parser = match MimeMessage::from_bytes_with_partial(context, imf_raw, is_partial_download).await { Err(err) => { - warn!(context, "receive_imf: can't parse MIME: {}", err); + warn!(context, "receive_imf: can't parse MIME: {:#}", err); let msg_ids; if !rfc724_mid.starts_with(GENERATED_PREFIX) { let row_id = context @@ -253,7 +253,7 @@ pub(crate) async fn receive_imf_inner( if from_id == ContactId::SELF { if mime_parser.was_encrypted() { if let Err(err) = context.execute_sync_items(sync_items).await { - warn!(context, "receive_imf cannot execute sync items: {}", err); + warn!(context, "receive_imf cannot execute sync items: {:#}", err); } } else { warn!(context, "sync items are not encrypted."); @@ -268,7 +268,7 @@ pub(crate) async fn receive_imf_inner( .receive_status_update(from_id, insert_msg_id, status_update) .await { - warn!(context, "receive_imf cannot update status: {}", err); + warn!(context, "receive_imf cannot update status: {:#}", err); } } @@ -290,7 +290,10 @@ pub(crate) async fn receive_imf_inner( context.emit_event(EventType::ChatModified(chat_id)); } Err(err) => { - warn!(context, "receive_imf cannot update profile image: {}", err); + warn!( + context, + "receive_imf cannot update profile image: {:#}", err + ); } }; } @@ -317,7 +320,7 @@ pub(crate) async fn receive_imf_inner( ) .await { - warn!(context, "cannot update contact status: {}", err); + warn!(context, "cannot update contact status: {:#}", err); } } @@ -495,7 +498,7 @@ async fn add_parts( securejoin_seen = false; } Err(err) => { - warn!(context, "Error in Secure-Join message handling: {}", err); + warn!(context, "Error in Secure-Join message handling: {:#}", err); chat_id = Some(DC_CHAT_ID_TRASH); securejoin_seen = true; } @@ -730,7 +733,7 @@ async fn add_parts( chat_id = None; } Err(err) => { - warn!(context, "Error in Secure-Join watching: {}", err); + warn!(context, "Error in Secure-Join watching: {:#}", err); chat_id = Some(DC_CHAT_ID_TRASH); } } @@ -870,7 +873,7 @@ async fn add_parts( Err(err) => { warn!( context, - "can't parse ephemeral timer \"{}\": {}", value, err + "can't parse ephemeral timer \"{}\": {:#}", value, err ); EphemeralTimer::Disabled } @@ -926,7 +929,7 @@ async fn add_parts( { warn!( context, - "failed to modify timer for chat {}: {}", chat_id, err + "failed to modify timer for chat {}: {:#}", chat_id, err ); } else { info!( @@ -975,7 +978,7 @@ async fn add_parts( if chat.is_protected() || new_status.is_some() { if let Err(err) = check_verified_properties(context, mime_parser, from_id, to_ids).await { - warn!(context, "verification problem: {}", err); + warn!(context, "verification problem: {:#}", err); let s = format!("{}. See 'Info' for more details", err); mime_parser.repl_msg_by_error(&s); } else { @@ -1487,7 +1490,7 @@ async fn create_or_lookup_group( let create_protected = if mime_parser.get_header(HeaderDef::ChatVerified).is_some() { if let Err(err) = check_verified_properties(context, mime_parser, from_id, to_ids).await { - warn!(context, "verification problem: {}", err); + warn!(context, "verification problem: {:#}", err); let s = format!("{}. See 'Info' for more details", err); mime_parser.repl_msg_by_error(&s); } @@ -1685,7 +1688,7 @@ async fn apply_group_changes( if mime_parser.get_header(HeaderDef::ChatVerified).is_some() { if let Err(err) = check_verified_properties(context, mime_parser, from_id, to_ids).await { - warn!(context, "verification problem: {}", err); + warn!(context, "verification problem: {:#}", err); let s = format!("{}. See 'Info' for more details", err); mime_parser.repl_msg_by_error(&s); } diff --git a/src/sql.rs b/src/sql.rs index f24008390..1203a276e 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -626,26 +626,26 @@ pub async fn housekeeping(context: &Context) -> Result<()> { if let Err(err) = remove_unused_files(context).await { warn!( context, - "Housekeeping: cannot remove unusued files: {}", err + "Housekeeping: cannot remove unusued files: {:#}", err ); } if let Err(err) = start_ephemeral_timers(context).await { warn!( context, - "Housekeeping: cannot start ephemeral timers: {}", err + "Housekeeping: cannot start ephemeral timers: {:#}", err ); } if let Err(err) = prune_tombstones(&context.sql).await { warn!( context, - "Housekeeping: Cannot prune message tombstones: {}", err + "Housekeeping: Cannot prune message tombstones: {:#}", err ); } if let Err(err) = deduplicate_peerstates(&context.sql).await { - warn!(context, "Failed to deduplicate peerstates: {}", err) + warn!(context, "Failed to deduplicate peerstates: {:#}", err) } context.schedule_quota_update().await?;