From a352f4c7546cd1097068e45af063c77554fd2a73 Mon Sep 17 00:00:00 2001 From: Arthur Tucker Date: Sun, 10 Dec 2023 09:23:51 -0700 Subject: [PATCH] remove public errors --- main.dart | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/main.dart b/main.dart index 2213417..379d113 100644 --- a/main.dart +++ b/main.dart @@ -57,17 +57,16 @@ Future processMessage(final TeleDartMessage message) async { print(url); // Testing if yt-dlp can process the video + // TODO: implement way to sendChatAction while processing & downloading final io.ProcessResult simulateResult = await runYtDlp(url, simulate: true); if (simulateResult.exitCode != 0) { - publicError( - message, 'yt-dlp failed to process $url\n${simulateResult.stderr}'); + print('yt-dlp failed to process $url\n${simulateResult.stderr}'); continue; } // Using yt-dlp to download the video final io.ProcessResult downloadResult = await runYtDlp(url, dir: downloadDir); if (downloadResult.exitCode != 0) { - publicError( - message, 'yt-dlp failed to download $url\n${downloadResult.stderr}'); + print('yt-dlp failed to download $url\n${downloadResult.stderr}'); continue; } // TODO: make sure these files exist @@ -105,11 +104,6 @@ String generateCaption(final Map info) { return caption.replaceAll(regex, ''); } -void publicError(final TeleDartMessage message, final String error) { - print('Error!! \n$error'); - message.reply(error, withQuote: true, disableNotification: true); -} - // TODO: extend ProcessResult class to return some more data Future runYtDlp(final String videoUrl, {final bool simulate = false, String dir = '/tmp'}) {