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 autolearn=no autolearn_force=no version=3.4.6 Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id 7B5187E427; Sun, 8 Jan 2023 06:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673159778; bh=kUPkKFnTO58rG3vLTvN5hF/vb8Ms1KXjmhF2qGp2YPQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j68aHM8DxsXUR8/5N6G/jomaUk5OXC9OIshEjlkZgtOF3nlOPICz7/MTCwf+yHXsu KciioqMhnihjooe8fK/amfQJneJ7wrY476r00iBocBJAx2fXZbNOOAGEWolG0f8QZ3 nrPRhBvW/F5X4uE9f+hB7p6JAVuhgbRi0mmnqTguQpY0CLMvkfwFhG0bIe8B4NpQvB tJ9f0IXk/DBqHl/iDaGMd+NriDBCe2WwKz02Wu4LsGOjWWg24p6npSawoBj2WTZ2Na KtPKZ7Xp8OULovyUx+/2sa5zMKczHPBsd0MzbKz4eSM6QNLs9ju0PGzV/E0yN1q20j qjY4k/A7gZGPw== Date: Sun, 8 Jan 2023 13:36:13 +0700 From: Ammar Faizi To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: Re: [PATCH v2 05/11] telegram: Implement the DaemonException() and refactor report_err() Message-ID: References: <20230108061543.1780-1-kiizuha@gnuweeb.org> <20230108061543.1780-6-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230108061543.1780-6-kiizuha@gnuweeb.org> List-Id: On Sun, Jan 08, 2023 at 01:15:37PM +0700, Muhammad Rizki wrote: > @@ -77,8 +78,9 @@ class Bot(): > await self.__handle_atom_url(url) > except (OperationalError, DatabaseError) as e: > await self.handle_db_error(e) > - except: > - await self.client.report_err(url) > + except DaemonException as e: > + e.set_atom_url(url) > + await self.client.report_err(e) What is wrong with you? I have told you like 3 times about this. You need to handle a generic exception as well. Because if it throws an exception inside `self.db.get_atom_urls()`, we will not get the report. An exception that is raised inside `self.db.get_atom_urls()` will not be converted into a DaemonException instance. That is why it's possible to get an exception that's not an instance of (OperationalError, DatabaseError, DaemonException). -- Ammar Faizi