worldomonation / mozbitbar

Tool to interact with Bitbar REST API.
Mozilla Public License 2.0
1 stars 0 forks source link

[mozbitbar-29] Use Mozbitbar prefix for Exception names? #60

Closed bclary closed 5 years ago

bclary commented 5 years ago

In https://github.com/worldomonation/mozbitbar/blob/master/mozbitbar/__init__.py the exception classes do not contain any reference to Mozbitbar when they are used in the code as in https://github.com/worldomonation/mozbitbar/blob/master/mozbitbar/bitbar_project.py#L8.

We lose any notion that these are Mozbitbar exceptions when we import using

from mozbitbar import FileException

I was wondering if we should not import them and instead use their fully qualified names like mozbitbar.FileException or rename them MozbitbarFileException, etc. so that when we did

from mozbitbar import MozbitbarFileException

its heritage is clear from its name.

https://github.com/requests/requests/blob/master/requests/exceptions.py is an example where a prefix is not generally used while https://github.com/taskcluster/taskcluster-client.py/blob/master/taskcluster/exceptions.py is an example of where it is.

What do you think?

worldomonation commented 5 years ago

I had initially chosen not to use prefixes in similar vein to Requests and Websocket-client (two projects I referred to for pointers).

However, keeping in line with other Mozbase harnesses, I've renamed all exceptions in #73 and #74. They are all now prefixed by Mozbitbar.