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, URIBL_BLOCKED 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 1D7577E2BE; Sat, 7 Jan 2023 06:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673071829; bh=/jSqvLFqCXFn714S4XSu3XVFaTJo2EkqJhOjM524uOQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oLhFeTBYPp5k5UWmT2YlxZkEC7Nx3lqJgcEt7h/zanjp03WR58ECyuB/QOJG5Z3RO hZeJ6TRsBt8oYOupiImomvSCExMjLvC4BPD9C52LL2furCwWYIUv2C7/bKurkWYWlp GV9Os4zuiP0bhX734EZCF+veaJM+qrK/YMcpGWmCLsosCQTyFzIDwk0GO511MOxZq0 EFFqGdHZoRcNiDoOiaWwsiJcxgthgMVIyWYhvsSr4wfDaCVai7dG13abIasi24MCXp h/itv7J+P6yAJbTzM2FASkCHP3f3PzQ+CVbNrRb0tEVqf0Wxn+zlqoxcSQh8O7us9d p9bNmuay5/D7A== Message-ID: <35794058-acf0-5e37-236c-7d5d0f7cabaa@gnuweeb.org> Date: Sat, 7 Jan 2023 13:10:24 +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 v1 08/13] feat(discord): Implement the report_err() To: Ammar Faizi Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20230103063641.1680-1-kiizuha@gnuweeb.org> <20230103063641.1680-9-kiizuha@gnuweeb.org> <0a41da94-dae1-2285-4438-de6f026dc059@gnuweeb.org> Content-Language: en-US From: Muhammad Rizki In-Reply-To: <0a41da94-dae1-2285-4438-de6f026dc059@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 04/01/2023 05.20, Ammar Faizi wrote: > On 1/3/23 7:20 PM, Muhammad Rizki wrote: >> I already added the same custom exception, DaemonException() is >> reusable error class for both Telegram and Discord. The location is >> in the exceptions.py in the daemon directory. > > [ Sending this again because it seems you didn't care with my next reply ] > > OK, just took a look at patch #12, and you implemented it there. > But why should we implement the broken report_err() first, then > the fixed report_err() with DaemonException? > > I think implementing the old broken exception handling design is > not needed, just go with the DaemonException pattern we agree on. > I still don't understand what's your mean, you mean this? atom_url = None try: for atom_url in self.db.get_atom_urls(): await self.__handle_atom_url(atom_url) except (OperationalError, DatabaseError) as e: await self.handle_db_error(e) except (TelegramDaemonException) as e: e.set_atom_url(atom_url) await self.client.report_err(e) except e_orig: e = DaemonException() e.set_atom_url(atom_url) e.set_thread_url(None) e.set_message(e_orig) await self.client.report_err(e) def report_err(self, e: DaemonException): pass