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

@@ -360,7 +360,7 @@ pub(crate) async fn smtp_send(
if let SendResult::Failure(err) = &status {
// We couldn't send the message, so mark it as failed
message::set_msg_failed(context, msg_id, Some(err.to_string())).await;
message::set_msg_failed(context, msg_id, &err.to_string()).await;
}
status
}
@@ -410,12 +410,7 @@ pub(crate) async fn send_msg_to_smtp(
)
.await?;
if retries > 6 {
message::set_msg_failed(
context,
msg_id,
Some("Number of retries exceeded the limit."),
)
.await;
message::set_msg_failed(context, msg_id, "Number of retries exceeded the limit.").await;
context
.sql
.execute("DELETE FROM smtp WHERE id=?", paramsv![rowid])