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
Lotus::Mailer::MissingDeliveryDataError buble up Mail::ArgumentError messages #41
Conversation
…gumentError message, so we have a more descriptive error message, helpful if your setup code is wrong or something.
to me the PR is ok, I'm not a big fan concat string with cc @lotus/core-team |
Will remember to use |
@@ -22,6 +22,16 @@ | |||
-> { MissingToMailer.deliver }.must_raise Lotus::Mailer::MissingDeliveryDataError | |||
end | |||
|
|||
it "Lotus::Mailer::MissingDeliveryDataError bubles up the original Mail::ArgumentError message" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about rewording it so that a verb follows after it
.
s/bubles/bubbles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense, will change it and resend :)
…of #assert_raised;
Updated it. Should be good to go xD |
Lotus::Mailer::MissingDeliveryDataError buble up Mail::ArgumentError messages
@mrbongiolo @joneslee85 We should reconsider this code. I'm for detailed exception messages, and showing the original reason of the error is a good practice.
This can generate confusion. I'm gonna revert this commit. |
Maybe we could inform just to check the config or something? The main thing is that not only a missing |
Since basically I just had to "check" the Original errors message and figure out that I had an error on my Mailer.config and not on the mailer itself. |
"Missing delivery data, please check 'from', or 'to'. If those are ok please check your Lotus::Mailer config file." something like this. Sorry about the 3 messages in a row. |
@mrbongiolo Which was your case that left you confused? Which configuration you did it wrong? |
Lotus::Mailer.configure do
root 'app/notifiers/mailers/templates'
case ENV['RACK_ENV']
when 'production', 'staging'
delivery_method :smtp,
address: 'email-smtp.us-east-1.amazonaws.com',
port: '587',
domain: 'domain.com.br',
user_name: ENV['AWS_SES_SMTP_KEY'],
password: ENV['AWS_SES_SMTP_SECRET'],
authentication: 'plain',
enable_starttls_auto: true
when 'development', 'test'
delivery_method :test
end
end.load! Here inside my config block I had a wrong value for one of the options, can't really remember which one, but when I tested to send an email the Exception message said only to check |
Per issue: #38