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

HTTPError not being caught #74

Closed
danniehakan opened this issue Oct 27, 2017 · 3 comments · Fixed by #82
Closed

HTTPError not being caught #74

danniehakan opened this issue Oct 27, 2017 · 3 comments · Fixed by #82

Comments

@danniehakan
Copy link

danniehakan commented Oct 27, 2017

I'm having issues with an HTTPError not being caught by SendgridBackend.send_messages. The error is python_http_client.exceptions.BadRequestsError: HTTP Error 400: Bad Request, from what I can see it should be caught if fail_silently = True(rather, it should not be rethrown), which is the case in my unittest.

Python: 3.6.0
Django: 1.10.7

Any ideas?

@danniehakan
Copy link
Author

Could it be an issue related to python 3 compatibility?

@danniehakan
Copy link
Author

It seems like the exceptions that are raised, contained in python_http_client.exceptions, are actually not the ones we are trying to catch, since they are not based on urllib.

@wwrinkle
Copy link

wwrinkle commented Dec 6, 2017

I'm having the same issue. Any help would be appreciated.

martey added a commit to mobolic/sendgrid-django that referenced this issue Oct 18, 2018
This reverts commit e4dfae4, which
tries to fix elbuo8#74 by importing HTTPError from `python_http_client`. This
change isn't necessary, since the error in elbuo8#74 was being caused by a bug
in `sendgrid-python` which resulted in the wrong version of
`python_http_client` being installed:
sendgrid/sendgrid-python#321

Since the bug is fixed in sendgrid-python 4.2.1, but this library still
uses sendgrid-python 3.5+, I've added additional installation
constraints on `python_http_client` so that it should never install a
version with custom error handling (2.3.0 or above). This constraint
should be removed when we upgrade to `sendgrid-python` 4.
martey added a commit to mobolic/sendgrid-django that referenced this issue Oct 18, 2018
This reverts commit e4dfae4, which
tries to fix elbuo8#74 by importing HTTPError from `python_http_client`. This
change isn't necessary, since the error in elbuo8#74 was being caused by a bug
in `sendgrid-python` which resulted in the wrong version of
`python_http_client` being installed:
sendgrid/sendgrid-python#321

Since the bug is fixed in `sendgrid-python` 4.2.1, but this library
still uses `sendgrid-python` 3.5+, I've added additional installation
constraints on `python_http_client` so that it should never install a
version with custom error handling (2.3.0 or above). This constraint
should be removed when we upgrade to `sendgrid-python` 4.
martey added a commit to mobolic/sendgrid-django that referenced this issue Oct 18, 2018
This reverts commit e4dfae4, which
tries to fix elbuo8#74 by importing HTTPError from `python_http_client`. This
change isn't necessary, since the error in elbuo8#74 was being caused by a bug
in `sendgrid-python` which resulted in the wrong version of
`python_http_client` being installed:
sendgrid/sendgrid-python#321

Since the bug is fixed in `sendgrid-python` 4.2.1, but this library
still uses `sendgrid-python` 3.5+, I've added additional installation
constraints on `python_http_client` so that it should never install a
version with custom error handling (2.3.0 or above). This constraint
should be removed when we upgrade to `sendgrid-python` 4.
martey added a commit to mobolic/sendgrid-django that referenced this issue Jan 27, 2019
This reverts commit e4dfae4, which
tries to fix elbuo8#74 by importing HTTPError from `python_http_client`. That
change isn't necessary, since the error in elbuo8#74 was being caused by a bug
in `sendgrid-python` which resulted in the wrong version of
`python_http_client` being installed:
sendgrid/sendgrid-python#321

Since the bug is fixed in `sendgrid-python` 4.2.1, but this library
still uses `sendgrid-python` 3.5+, I've added additional installation
constraints on `python_http_client` so that it should never install a
version with custom error handling (2.3.0 or above). This constraint
should be removed when we upgrade to `sendgrid-python` 4.

This commit also adds a minimum version to pytest. pytest-django
requires pytest>=3.6. To prevent test failures, we need to ensure that
an up-to-date version of pytest is installed.
andriisoldatenko pushed a commit that referenced this issue Jan 27, 2019
This reverts commit e4dfae4, which
tries to fix #74 by importing HTTPError from `python_http_client`. That
change isn't necessary, since the error in #74 was being caused by a bug
in `sendgrid-python` which resulted in the wrong version of
`python_http_client` being installed:
sendgrid/sendgrid-python#321

Since the bug is fixed in `sendgrid-python` 4.2.1, but this library
still uses `sendgrid-python` 3.5+, I've added additional installation
constraints on `python_http_client` so that it should never install a
version with custom error handling (2.3.0 or above). This constraint
should be removed when we upgrade to `sendgrid-python` 4.

This commit also adds a minimum version to pytest. pytest-django
requires pytest>=3.6. To prevent test failures, we need to ensure that
an up-to-date version of pytest is installed.
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 a pull request may close this issue.

2 participants