[issue2551083] Derive Roundup exceptions from common base class other than BaseException

Robert Klonner <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Robert Klonner:

In roundup/exceptions.py there are some exceptions defined which are derived 
from BaseException. I have a use case where I have to handle those exceptions 
but I can't because they are using BaseException directly. I would have to 
catch it with "except BaseException:" which would result in also catching 
signals like keyboard interrupts or system exits).

I would propose to make a common exception class where all other custom Roundup 
exceptions are derived from. It is also done like this in the 
roundup/cgi/exceptions.py exceptions.

In addition I think we can derive the Roundup base exception class from 
"Exception" and not "BaseException" as the latter one should be used for built-
in exceptions and not user-defined exceptions.


roundup/exceptions.py

class RoundupException(Exception):
    pass

class Unauthorised(RoundupException):
    pass

class Reject(RoundupException):
    pass

...


If we align on this we could also go though the exceptions in 
roundup/cgi/exceptions.py and check for those concepts. We can import the 
RoundupException from roundup/exceptions.py and derive the exceptions for cgi.

----------
messages: 6898
nosy: schlatterbeck, tttech-klonner
severity: normal
status: new
title: Derive Roundup exceptions from common base class other than BaseException

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551083>
_________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.