email_verifier
email_verifier copied to clipboard
Expose cause for EmailVerifier::OutOfMailServersException
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
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?
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.