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 7CF9B7E426; Tue, 3 Jan 2023 12:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1672748448; bh=sYLw9MflHz5Ygjk4mlyafkHp7mjQs1HsyKw08cHQZgI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=NPV//z4FMGVToA23WCMijyk9AX+SYWqW6lTfS8ZpDQhv9GTN0I4onJxnshtJnIKgS 63fjv9Ojnf8Jcss9J/NCogOhD+wvp4Fnx/fhq53plYPus02acKSGVorBm9mmQPKxTk 0AoQ7UBLBtQDXpNYJRfUJFFND8A/ZfnUMDCv8WimruxH4pFGEnsFD3zxAUoPuwIJMe L7ke7Utkf6o5VG9u5kNL+piSPponjvMHQ52FaCkaRKaaPQHgzIaoXOHcBrqeanuMI+ YOvPa7erLhMqa0LshYUrb+61WGqYyfXIEMxDjAlK88Ji4fFw1hBhik9uulsriZ1f+P hE0q+zPRrIxEg== Message-ID: Date: Tue, 3 Jan 2023 19:20:44 +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() Content-Language: en-US To: Ammar Faizi Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20230103063641.1680-1-kiizuha@gnuweeb.org> <20230103063641.1680-9-kiizuha@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 03/01/2023 14.14, Ammar Faizi wrote: > On 1/3/23 1:36 PM, Muhammad Rizki wrote: >> --- a/daemon/dscord/mailer/listener.py >> +++ b/daemon/dscord/mailer/listener.py >> @@ -51,8 +51,13 @@ class Listener: >>       async def __run(self): >>           self.logger.info("Running...") >> -        for url in self.db.get_atom_urls(): >> -            await self.__handle_atom_url(url) >> +        url = None >> + >> +        try: >> +            for url in self.db.get_atom_urls(): >> +                await self.__handle_atom_url(url) >> +        except: >> +            await self.client.report_err(url) > > Why don't you implement the same custom exception for Discord? > > The exception issue when reporting the corresponding URL also exists on > the Discord daemon too. Yes? No? > 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.