Hi,
Until now, the normal way to create a new exception type was by inheriting from Exception. At least, it was the recommended way in the manual (and is still). In the development version and in the new 1.2 version, this is considered bad style and you get a warning if you inherit from Exception. It’s logic as there exist now catchable and non-catchable errors.
It is now recommended to inherit from OSError, IOError, ValueError or some other catchable error. OK, but I have written some code using a custom exception and this exception is not some kind of OSError, IOError, ValueError and so on. It’s an application exception which may be raised by miscellaneous causes. Inheriting from ValueError (one of the most general exception) makes little sense except in some particular cases.
Of course, it doesn’t matter a lot, but I don’t like things which are not logic and inheriting from ValueError would not be logic. For me, the best solution would be to inherit from CatchableError. Now, would this be considered OK or would it be also bad style?
CatchableError is good style if it's an exception that can be recovered from.
If otherwise it's bug or a situation where execution should be aborted, you should use Defect.
OK, thanks.
My question was for a catchable error but, indeed, maybe I could use two exceptions in this case, one catchable, the other not catchable.