Open JPTIZ opened 2 years ago
Some exception handling code take the generic type Exception in except and, in a couple cases:
Exception
except
https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L175 https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L220 https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L272
And, after #34 is merged:
https://github.com/caravelahc/pico-bot/blob/033e461622f419a3ab3edb3c100f3e1080ba2470/picobot/handlers.py#L342
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
Exception
inexcept
and, in a couple cases:https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L175 https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L220 https://github.com/caravelahc/pico-bot/blob/f4c6255ace0d49beb98b94e528f090f04fbd6b6b/picobot/handlers.py#L272
And, after #34 is merged:
https://github.com/caravelahc/pico-bot/blob/033e461622f419a3ab3edb3c100f3e1080ba2470/picobot/handlers.py#L342
So instead of doing:
We should slightly rework the code to get exceptions as: