python-dbus-next icon indicating copy to clipboard operation
python-dbus-next copied to clipboard

exception types could use a common base class

Open foresto opened this issue 2 years ago • 0 comments

The exception classes derive directly from various python exceptions, rather than sharing a single dbus-next-specific superclass.

Because of this, distinguishing dbus errors from other errors requires application code to wrap dbus-next calls in their own try/except blocks, and wrap other calls in separate try/except blocks (or else catch every dbus-next exception individually by name). The result is very cluttered code.

A coherent exception hierarchy would make dbus-next much nicer to work with, and allow application code to be simpler and easier to read.

foresto avatar Jan 30 '23 20:01 foresto