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

fail_silently doesn't capture exception #196

Open
gunnar-rydberg opened this issue Oct 16, 2020 · 4 comments
Open

fail_silently doesn't capture exception #196

gunnar-rydberg opened this issue Oct 16, 2020 · 4 comments

Comments

@gunnar-rydberg
Copy link

I get botocore.exceptions.ClientError when calling django.core.mail.message.send() with "fail_silently=True"

It seems django-ses 1.0.3 expects botocore.vendored.requests.packages.urllib3.exceptions.ResponseError ???

Some packages of interest that I use.:
boto3==1.7.75
botocore==1.10.84
django-ses==1.0.3
Django==1.11.28
M2Crypto==0.36.0
(And yes, python2)

For now I'm just making sure of capturing the ClientError myself.

@pcraciunoiu
Copy link
Contributor

If you'd like to submit a PR to fix, that'd be great.

cc @GitRon or @trecouvr in case you're interested in helping out on this one

@NyanKiyoshi
Copy link

For reference:

Looks like that's the official expected behavior. @gunnar-rydberg, what's the use-case where you want to set fail_silently to True?

@gunnar-rydberg
Copy link
Author

Discovered this when upgrading to latest django-ses because of the change to boto3.

I simply expect fail_silently=True to handle exception and not re-raise them as it did in previous versions of django-ses.

I want this code to capture error response from Amazon SES service. But for some reason I get botocore.exceptions.ClientError instead.

except ResponseError as err:

I'll see if can have some time to investigate this further. Maybe this is due to us using oldish packages like Django 1.11?

@GitRon
Copy link
Contributor

GitRon commented Oct 20, 2020

If you'd like to submit a PR to fix, that'd be great.

cc @GitRon or @trecouvr in case you're interested in helping out on this one

Hi @trecouvr - sorry but I am super busy right now 😔 No chance of me submitting anything these weeks...

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

No branches or pull requests

4 participants