public inbox for [email protected]
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
	"GNU/Weeb Mailing List" <[email protected]>
Subject: Re: [PATCH v2 05/11] telegram: Implement the DaemonException() and refactor report_err()
Date: Sun, 8 Jan 2023 14:15:38 +0700	[thread overview]
Message-ID: <CAOG64qPEnmiAn_u1GRdFcsrefiXQMd8mDFoxVV9ca-_CxTraqg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>

On Sun, Jan 8, 2023 at 1:36 PM Ammar Faizi wrote:
> 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).

Maybe you need to give a small pseudo-code so it's clear to him. My
understanding will be adding an "except" statement without specifying
any exception class name, no?

  reply	other threads:[~2023-01-08  7:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-08  6:15 [PATCH v2 00/11] Improvements, refactors, and features Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 01/11] discord: Remove unnecessary try/except block Muhammad Rizki
2023-01-08  6:48   ` Ammar Faizi
2023-01-08  7:45     ` Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 02/11] telegram: Perform graceful exit when interrupted by a signal Muhammad Rizki
2023-01-08  6:58   ` Alviro Iskandar Setiawan
2023-01-08  7:46     ` Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 03/11] Add DaemonException() class Muhammad Rizki
2023-01-08  6:47   ` Ammar Faizi
2023-01-08  7:46     ` Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 04/11] telegram: Refactor report_err() and move to the DaemonClient() class Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 05/11] telegram: Implement the DaemonException() and refactor report_err() Muhammad Rizki
2023-01-08  6:36   ` Ammar Faizi
2023-01-08  7:15     ` Alviro Iskandar Setiawan [this message]
2023-01-08  7:23       ` Ammar Faizi
2023-01-08  7:48         ` Muhammad Rizki
2023-01-08  7:25       ` Ammar Faizi
2023-01-08  6:15 ` [PATCH v2 06/11] telegram: listener: Remove unnecessary try/except block Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 07/11] discord: add report_err() for the Discord bot Muhammad Rizki
2023-01-08  6:49   ` Ammar Faizi
2023-01-08  6:15 ` [PATCH v2 08/11] discord: Implement the report_err() and DaemonException() error class Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 09/11] discord: database: Add ping() method for reconnect MySQL Muhammad Rizki
2023-01-08  6:51   ` Ammar Faizi
2023-01-08  6:15 ` [PATCH v2 10/11] discord: listener: Add handle_db_error to handle the MySQL errors Muhammad Rizki
2023-01-08  6:15 ` [PATCH v2 11/11] telegram: Rename the Telegram bot custom client Muhammad Rizki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOG64qPEnmiAn_u1GRdFcsrefiXQMd8mDFoxVV9ca-_CxTraqg@mail.gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox