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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.126.135]) by gnuweeb.org (Postfix) with ESMTPSA id C3F7E7E24D; Sun, 8 Jan 2023 07:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673164089; bh=+/gJBAhf+x86JXlHNRBnFe06ukbOG01Wgw9gfAzL5tE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iZCAifQNDs1OTax8gvC8mGgfYhnLKrJuIYcs0qEMUymMSOS2gltMPDY2EWgc81N+k w1VyF79zt5U+QrCTUHZM9ETgWvqx67jC9caCkWcCtTt7ikqtm0OPSsnsPNPsMPTJpk JGSQZZAJPpzWH+FvU3G0wcQWNEvR1ugq4HU77a2CYt300h4Y5xMPkcVJ8lnlhc45PT 8zIpCI+vJEICQsoNm9ziEa7R62vdE3Ae0tMXh184E/MDH1rbszF8Gyyk0dDUt7FHik NiAQ6GiIspk/Fm4NKTdkp2PuD6+rKBEgnT908hOi5IuO5C6rjNFWkAdEQOkt00yAMy l9eyFRH3S2Rww== Message-ID: Date: Sun, 8 Jan 2023 14:48:05 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 05/11] telegram: Implement the DaemonException() and refactor report_err() Content-Language: en-US To: Ammar Faizi , Alviro Iskandar Setiawan Cc: GNU/Weeb Mailing List References: <20230108061543.1780-1-kiizuha@gnuweeb.org> <20230108061543.1780-6-kiizuha@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 08/01/2023 14.23, Ammar Faizi wrote: > On Sun, Jan 08, 2023 at 02:15:38PM +0700, Alviro Iskandar Setiawan wrote: >> Maybe you need to give a small pseudo-code so it's clear to him. > > Like I didn't? I definitely did that. Please stop this retardation. I'm > very tired of getting ignored when giving reviews. Let me emphasize it > with a block of comment this time. > > url = None > try: > for url in self.db.get_atom_urls(): > await self.__handle_atom_url(url) > except (OperationalError, DatabaseError) as e: > await self.handle_db_error(e) > except DaemonException as e: > e.set_atom_url(url) > await self.client.report_err(e) > except: > # > # This is needed because if an exception is > # raised inside self.db.get_atom_urls(), we > # will catch it here. > # > # At this point, we have an atom_url, but > # no thread_url. > # > > e = DaemonException() > e.set_atom_url(url) > e.set_thread_url(None) > await self.client.report_err(e) OK, I'll implement this. > > >> My understanding will be adding an "except" statement without specifying >> any exception class name, no? > > Yes, you are correct. >