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") .mime_type("video/x-matroska")
.file(uploaded); .file(uploaded);
if let Err(err) = tclient.send_message(&chat, message).await { 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 if let Err(err) = tclient
.send_message( .send_message(
&chat, &chat,
InputMessage::text("Failed to send video, see logs"), InputMessage::text(&format!(
"Failed to send video {}, see logs",
&video_id
)),
) )
.await .await
{ {
eprintln!( eprintln!(
"Failed to send message about failing to send video: {:?}", "Failed to send message about failing to send video {}: {:?}",
err &video_id, err
); );
} }
} }
} }
Err(err) => { Err(err) => {
success = false; success = false;
eprintln!("Failed to upload video: {:?}", err); eprintln!("Failed to upload video {}: {:?}", &video_id, err);
if let Err(err) = tclient if let Err(err) = tclient
.send_message( .send_message(
&chat, &chat,
InputMessage::text("Failed to upload video, see logs"), InputMessage::text(&format!(
"Failed to upload video {}, see logs",
&video_id
)),
) )
.await .await
{ {
eprintln!( eprintln!(
"Failed to send message about failing to upload video: {:?}", "Failed to send message about failing to upload video {}: {:?}",
err &video_id, err
); );
} }
} }