From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.126.135]) by gnuweeb.org (Postfix) with ESMTPSA id B43317E46B; Tue, 3 Jan 2023 06:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672727834; bh=+8y/VcLi9a36KCgJvKoIVr8JDQBFew4MZSPJzW53pio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzckGh4OTbp+Ksrz4Me0/FEPDB3N0cnwr2KBC951Q1UEP3ldOc+UwQLXDoX6VqdvU pWJT1zbndDb5mhdAXw2KzoK+20YSdayULMvnkpE6vuWqCId4osI0CGu/NGRv74nsAv Wr0ieiWM+5j9lhufT7jLECp6Ed2p2h2AyPsJz7IXTBKHOiTC5ThNhuKIAEf1tHGVdb J1M6HW2PKFvW0EKCO68OiQEMiuBWfO6UFEQs+y3pPwoeO0I6vC7bd+r+SogfjGgGFA gBA98Wp4QtZTU/wDog0GG6fmYCEuSdNCp3+tEcMJoTMRykipP7VaExUELpNKklXVUp PmF7Cq8DmCbAA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 06/13] refactor(telegram/mailer)!: Remove unnecessary try/except block Date: Tue, 3 Jan 2023 13:36:34 +0700 Message-Id: <20230103063641.1680-7-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20230103063641.1680-1-kiizuha@gnuweeb.org> References: <20230103063641.1680-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The error handling is already been moved to the __handle_atom_url() so it's not necessary to use try/except block again. Signed-off-by: Muhammad Rizki --- daemon/telegram/mailer/listener.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/daemon/telegram/mailer/listener.py b/daemon/telegram/mailer/listener.py index d2d9a5e..e906b1f 100644 --- a/daemon/telegram/mailer/listener.py +++ b/daemon/telegram/mailer/listener.py @@ -127,14 +127,7 @@ class Bot(): self.logger.debug(md) return False - try: - text, files, is_patch = utils.create_template(mail, Platform.TELEGRAM) - except: - exc_str = utils.catch_err() - self.logger.warning(exc_str) - await self.client.send_log_file(url) - return - + text, files, is_patch = utils.create_template(mail, Platform.TELEGRAM) reply_to = self.get_reply(mail, tg_chat_id) url = str(re.sub(r"/raw$", "", url)) -- Muhammad Rizki