refactor: resultify set_msg_failed()

This commit is contained in:
link2xt
2023-07-08 23:59:45 +00:00
parent 7aac4bfc83
commit 27e177dc05
4 changed files with 33 additions and 33 deletions

View File

@@ -492,7 +492,9 @@ 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, &err.to_string()).await;
if let Err(err) = message::set_msg_failed(context, msg_id, &err.to_string()).await {
error!(context, "Failed to mark {msg_id} as failed: {err:#}.");
}
}
status
}
@@ -539,7 +541,7 @@ pub(crate) async fn send_msg_to_smtp(
)
.await?;
if retries > 6 {
message::set_msg_failed(context, msg_id, "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=?", (rowid,))