Roundup Tracker - Issues

Message6898

Author tttech-klonner
Recipients schlatterbeck, tttech-klonner
Date 2020-03-25.07:27:34
Message-id <1585121254.8.0.412971837801.issue2551083@roundup.psfhosted.org>
In-reply-to
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.
History
Date User Action Args
2020-03-25 07:27:34tttech-klonnersetrecipients: + tttech-klonner, schlatterbeck
2020-03-25 07:27:34tttech-klonnersetmessageid: <1585121254.8.0.412971837801.issue2551083@roundup.psfhosted.org>
2020-03-25 07:27:34tttech-klonnerlinkissue2551083 messages
2020-03-25 07:27:34tttech-klonnercreate