Repository: mercurial
Revision: 132
Author: Bill Shannon <bill.shannon_at_sun.com>
Date: 2009-04-10 23:58:03 UTC
Link:
http://kenai.com/projects/javamail/sources/mercurial/revision/132
Log Message:
-----------
Provide more precise and useful exception message.
Modified Paths:
--------------
mail/src/main/java/javax/mail/Service.java
Diffs:
-----
diff -r 133512dd660c -r ce99f7beaab3
mail/src/main/java/javax/mail/Service.java
--- a/mail/src/main/java/javax/mail/Service.java Mon Mar 09
20:45:53 2009 -0700
+++ b/mail/src/main/java/javax/mail/Service.java Fri Apr 10
16:58:03 2009 -0700
@@ -318,6 +318,12 @@
if (!connected) {
if (authEx != null)
throw authEx;
+ else if (user == null)
+ throw new AuthenticationFailedException(
+ "failed to connect, no user name specified?");
+ else if (password == null)
+ throw new AuthenticationFailedException(
+ "failed to connect, no password specified?");
else
throw new AuthenticationFailedException("failed to
connect");
}