Mention video id when failing to send/upload video

This commit is contained in:
blank X 2021-06-22 12:36:27 +07:00
parent 8c2db3c958
commit 76dfd825f3
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 14 additions and 8 deletions

View File

@ -679,34 +679,40 @@ pub async fn upload_worker(
.mime_type("video/x-matroska")
.file(uploaded);
if let Err(err) = tclient.send_message(&chat, message).await {
eprintln!("Failed to send video: {:?}", err);
eprintln!("Failed to send video {}: {:?}", &video_id, err);
if let Err(err) = tclient
.send_message(
&chat,
InputMessage::text("Failed to send video, see logs"),
InputMessage::text(&format!(
"Failed to send video {}, see logs",
&video_id
)),
)
.await
{
eprintln!(
"Failed to send message about failing to send video: {:?}",
err
"Failed to send message about failing to send video {}: {:?}",
&video_id, err
);
}
}
}
Err(err) => {
success = false;
eprintln!("Failed to upload video: {:?}", err);
eprintln!("Failed to upload video {}: {:?}", &video_id, err);
if let Err(err) = tclient
.send_message(
&chat,
InputMessage::text("Failed to upload video, see logs"),
InputMessage::text(&format!(
"Failed to upload video {}, see logs",
&video_id
)),
)
.await
{
eprintln!(
"Failed to send message about failing to upload video: {:?}",
err
"Failed to send message about failing to upload video {}: {:?}",
&video_id, err
);
}
}