force a reason when calling set_msg_failed() (#3410)

* force a reason when calling `set_msg_failed()`

the string is displayed to the user,
so even _some_ context as "NDN without further details"
is better than an empty string.

* make clippy happy

* add CHANGELOG entry
This commit is contained in:
bjoern
2022-06-08 21:25:34 +02:00
committed by GitHub
parent db28349703
commit d286872782
6 changed files with 15 additions and 20 deletions

View File

@@ -2068,7 +2068,7 @@ async fn create_send_msg_job(context: &Context, msg_id: MsgId) -> Result<Option<
let rendered_msg = match mimefactory.render(context).await {
Ok(res) => Ok(res),
Err(err) => {
message::set_msg_failed(context, msg_id, Some(err.to_string())).await;
message::set_msg_failed(context, msg_id, &err.to_string()).await;
Err(err)
}
}?;
@@ -2078,7 +2078,7 @@ async fn create_send_msg_job(context: &Context, msg_id: MsgId) -> Result<Option<
message::set_msg_failed(
context,
msg_id,
Some("End-to-end-encryption unavailable unexpectedly."),
"End-to-end-encryption unavailable unexpectedly.",
)
.await;
bail!(