Comments (6)
Hello @benjamin79, do you think this commit could help you to fix your issue?
Basically you could match some specific errors this way:
def send_an_email(email) do
try do
MyApp.Mailer.deliver_now(email)
rescue
error in Bamboo.SMTPAdapter.SMTPError ->
case error.raw do
{:retries_exceeded, _} ->
IO.inspect("I can do some stuff when this error match")
_ ->
IO.inspect "I don't care about these ones"
end
# Here, I can re-raise the error
raise error
end
end
from bamboo_smtp.
Thank you, looks good. Will give it a try.
from bamboo_smtp.
Cool - Let us now if it works as you expect. If it is, we will release it.
from bamboo_smtp.
There is 1 end
too much. It works - almost. For example if i set the wrong to i get the following in error:
%Bamboo.SMTPAdapter.SMTPError{message: "There was a problem sending the email through SMTP.\n\nThe error is :no_more_hosts\n\nMore detail below:\n\n{:permanent_failure, \"email-server", \"501 Invalid RCPT TO address provided\\r\\n\"}\n"}
So no error.raw
. Iยดm using aws ses if it is important.
from bamboo_smtp.
- too much
end
: Thanks - I will fix the documentation. - Are you sure to use the correct branch (i.e:
feature/#50-catch_error
)? The fix is not yet released, we wanted you to test the branch to be sure it works as you expect before creating a new release.
On the branch feature/#50-catch_error
, the error should be:
%Bamboo.SMTPAdapter.SMTPError{
raw: {:no_more_hosts, {:permanent_failure, \"email-server", \"501 Invalid RCPT TO address provided\\r\\n\"}},
message: "There was a problem sending the email through SMTP.\n\nThe error is :no_more_hosts\n\nMore detail below:\n\n{:permanent_failure, \"email-server", \"501 Invalid RCPT TO address provided\\r\\n\"}\n"}
To use the branch feature/#50-catch_error
, you need to update your mix.exs
file to be:
defp deps do
[ # some deps...
{:bamboo_smtp, github: "fewlinesco/bamboo_smtp", branch: "feature/#50-catch_error"}
]
end
from bamboo_smtp.
Great, works. Thank you.
from bamboo_smtp.
Related Issues (20)
- problem with eml attachment HOT 1
- Getting TLS error when sending email HOT 2
- Refactor the way we add attachments to emails
- Issue when providing a custom config and using response: true HOT 1
- Connect per IPv6 HOT 7
- {:nocatch, {:permanent_failure, "501 Invalid command or cannot parse to address\r\n"}} HOT 1
- Subject character encoding HOT 7
- SendGrid will soon stop supporting auth with username and password HOT 2
- Cannot install dependency on phoenix 1.5.7 HOT 6
- Cannot install dependency on phoenix 1.5.7 HOT 1
- Breaking changes coming to Bamboo v2.0.0 HOT 5
- Update gen_smtp to 1.1.1
- Warnings after upgrading to otp-24 HOT 17
- function :crypto.hmac/3 is undefined or private HOT 7
- Support for Bamboo 2.2 HOT 1
- Upgrading to Heroku-20 stack (Ubuntu 20.04) seems to cause emails to not be sent HOT 2
- bamboo_smtp dependencies warning (hut) HOT 3
- Problem Encoding Comma in Filename HOT 1
- Upgrade Bamboo dependency from 2.2.0 to 2.3.0
- Dead project? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bamboo_smtp.