Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Exception re-raising in models/events.py #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 21, 2022

  1. Fix Exception re-raising in models/events.py

    Exceptions do not have message attribute in Python 3.
    
    See [PEP-352](https://peps.python.org/pep-0352/)
    
    Also, and this is my opinion, it doesn't offer any value to re-raise the JSON decode error as something else. I would propose this change too:
    
    ```diff
    -try:
    -    webhook_data = json.loads(json_data)
    -except (TypeError, ValueError) as ex:
    -     raise Exception("The passed json_data is not JSON formatted . {}".format(str(ex)))
    +webhook_data = json.loads(json_data)
    ```
    kbairak authored Jun 21, 2022
    Configuration menu
    Copy the full SHA
    968c85a View commit details
    Browse the repository at this point in the history