Skip to content

Expose cause for EmailVerifier::OutOfMailServersException#33

Open
g0ody wants to merge 1 commit intokamilc:masterfrom
platogo:master
Open

Expose cause for EmailVerifier::OutOfMailServersException#33
g0ody wants to merge 1 commit intokamilc:masterfrom
platogo:master

Conversation

@g0ody
Copy link
Copy Markdown

@g0ody g0ody commented Mar 24, 2016

We needed the internal reason why EmailVerifier::OutOfMailServersException was caused. If retry is used rubies nested exceptions do not work.

begin
  EmailVerifier.check(email)
rescue EmailVerifier::OutOfMailServersException => e
  p e.cause
end

@adamof
Copy link
Copy Markdown

adamof commented Feb 3, 2017

Hey @g0ody, we're having some issues, since we are receiving this exception for emails that are actually valid. Can you explain how your change affects the behaviour of the gem?

@g0ody
Copy link
Copy Markdown
Author

g0ody commented Feb 6, 2017

Before it raise the EmailVerifier::OutOfMailServersException when servers are nil. This was caused by the retry. But this way you use the cause EmailVerifier::OutOfMailServersException, that is provided by ruby automatically if you raise an exception in a rescue function.

So I restructure the call so that the exception is raised in the rescue function, to be able to access the original execption when EmailVerifier::OutOfMailServersException is raised.

Other than that the behaviour stays the same.

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 this pull request may close these issues.

2 participants