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

Confusing error message with bad credentials #12

Closed
caseysoftware opened this issue Jan 15, 2013 · 8 comments
Closed

Confusing error message with bad credentials #12

caseysoftware opened this issue Jan 15, 2013 · 8 comments
Assignees

Comments

@caseysoftware
Copy link

I changed my SendGrid password yesterday for an unrelated reason and when one of my crons ran this morning, I received the error message below. While it mentions the authenticator, it doesn't give any indication of what the actual error was.

(Paths removed but otherwise message untouched.)

Fatal error: Uncaught exception 'Swift_TransportException' with message 'Expected response code 250 but got code "", with message ""' in /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/AbstractSmtpTransport.php:422
Stack trace:
#0 /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/AbstractSmtpTransport.php(306): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('', Array)
#1 /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/EsmtpTransport.php(224): Swift_Transport_AbstractSmtpTransport->executeCommand('RSET??', Array, Array)
#2 /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php(50): Swift_Transport_EsmtpTransport->executeCommand('RSET??', Array)
#3 /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/Esmtp/AuthHandler.php(170): Swift_Transport_Esmtp_Auth_LoginAuthenticator->authenticate in /[path]/vendor/sendgrid-php/lib/swift/classes/Swift/Transport/AbstractSmtpTransport.php on line 422
@theycallmeswift
Copy link
Contributor

What version of the library are you using?

@caseysoftware
Copy link
Author

I can't find a version number. :(

But I assume it's the latest because it has this commit: d292263

@martyndavies
Copy link
Contributor

@caseysoftware Is still this still an issue for you?

@caseysoftware
Copy link
Author

Yes, I just set incorrect credentials and received the same message. It could be as simple as catching the error and giving a more expressive error message.

Here's a post that covers one strategy: http://stackoverflow.com/a/2146171

@ghost ghost assigned theycallmeswift Apr 2, 2013
@theycallmeswift
Copy link
Contributor

My first thought was just to wrap the underlying call to the SwiftMailer send method in a try...catch. For whatever reason, that doesn't work. May have something to do with the version of SwiftMailer we are using. Will try again once we upgrade (coming in the next few days).

@motdotla
Copy link
Contributor

motdotla commented Jul 8, 2013

@caseysoftware this will be ready soon. It's part of version 1.0.3. Once I get access to push up to packagist, it will be available. Until then, you could setup your composer.json to look like:

...
"sendgrid/sendgrid": "dev-master"
...

https://packagist.org/packages/sendgrid/sendgrid

That will put you on edge, but if you can wait, just wait to version 1.0.3 is officially released.

Thanks for your help to us on all this.

@motdotla motdotla closed this as completed Jul 8, 2013
@caseysoftware
Copy link
Author

Thank you sir and much appreciated. :)

@motdotla
Copy link
Contributor

motdotla commented Jul 8, 2013

@caseysoftware that is live now as 1.0.3. By design you'll still have to catch the error, but now the error will look like this (just tested by hand as well on a separate project utilizing this library)

Uncaught exception 'SendGrid\AuthException' with message 'Bad username / password'

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