elmoiv / redvid

Smart downloader for Reddit hosted videos
GNU General Public License v3.0
110 stars 15 forks source link

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

Open yeroshalmimLF opened 4 months ago

yeroshalmimLF commented 4 months ago

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