Skip to content

changing BaseException to Exception so they follow Pep8 and are catchable without catching BaseExceptions#45

Open
AStrayByte wants to merge 1 commit intoelmoiv:masterfrom
AStrayByte:master
Open

changing BaseException to Exception so they follow Pep8 and are catchable without catching BaseExceptions#45
AStrayByte wants to merge 1 commit intoelmoiv:masterfrom
AStrayByte:master

Conversation

@AStrayByte
Copy link

This is my first public PR so bear with me if anything is wrong.

You are currently using BaseExceptions where Exceptions should be. Base Exceptions are for things like keyboard interrupts or quitting the program.

The normal except Exception as e: wont catch BaseExceptions which is how I found this as I was smashing my head into the desk wondering why your exceptions were stalling my asynchronous program and not being caught/handled.

A good explanation can be found here if you want more info: https://stackoverflow.com/questions/27995057/why-is-it-recommended-to-derive-from-exception-instead-of-baseexception-class-in
or in the PEP guide here: https://peps.python.org/pep-0008/#programming-recommendations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant