mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Show some inner errors (do not hide them with .context) (#1916)
This commit is contained in:
@@ -3242,7 +3242,8 @@ impl<T: Default, E: std::fmt::Display> ResultExt<T, E> for Result<T, E> {
|
|||||||
|
|
||||||
fn log_err(self, ctx: &Context, message: &str) -> Result<T, E> {
|
fn log_err(self, ctx: &Context, message: &str) -> Result<T, E> {
|
||||||
self.map_err(|err| {
|
self.map_err(|err| {
|
||||||
warn!(ctx, "{}: {}", message, err);
|
// We are using Anyhow's .context() and to show the inner error, too, we need the {:#}:
|
||||||
|
warn!(ctx, "{}: {:#}", message, err);
|
||||||
err
|
err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -3364,7 +3365,8 @@ pub unsafe extern "C" fn dc_accounts_new(
|
|||||||
match accs {
|
match accs {
|
||||||
Ok(accs) => Box::into_raw(Box::new(accs)),
|
Ok(accs) => Box::into_raw(Box::new(accs)),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("failed to create accounts: {}", err);
|
// We are using Anyhow's .context() and to show the inner error, too, we need the {:#}:
|
||||||
|
eprintln!("failed to create accounts: {:#}", err);
|
||||||
ptr::null_mut()
|
ptr::null_mut()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,8 @@ impl Context {
|
|||||||
Some(
|
Some(
|
||||||
self.stock_string_repl_str(
|
self.stock_string_repl_str(
|
||||||
StockMessage::ConfigurationFailed,
|
StockMessage::ConfigurationFailed,
|
||||||
err.to_string(),
|
// We are using Anyhow's .context() and to show the inner error, too, we need the {:#}:
|
||||||
|
format!("{:#}", err),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user