Some exception handling code take the generic type Exception in except and, in a couple cases:
|
if isinstance(exc, telegram.error.BadRequest): |
|
if isinstance(exc, telegram.error.BadRequest): |
|
if isinstance(exc, telegram.error.BadRequest): |
And, after #34 is merged:
|
if isinstance(exc, VideoTooLongError): |
So instead of doing:
except Exception as exc:
if isinstance(exc, SpecificType):
We should slightly rework the code to get exceptions as:
except SpecificType as error:
Some exception handling code take the generic type
Exceptioninexceptand, in a couple cases:pico-bot/picobot/handlers.py
Line 175 in f4c6255
pico-bot/picobot/handlers.py
Line 220 in f4c6255
pico-bot/picobot/handlers.py
Line 272 in f4c6255
And, after #34 is merged:
pico-bot/picobot/handlers.py
Line 342 in 033e461
So instead of doing:
We should slightly rework the code to get exceptions as: