[jcifs] Patch: Better exception message for failed connects

Michael B Allen mba2000 at ioplex.com
Wed Mar 15 20:33:01 GMT 2006

On Wed, 15 Mar 2006 13:13:33 -0500
"Mark Doliner" <Mark.Doliner at sas.com> wrote:

> I have the following bit of code which throws an SmbException:
> > UniAddress address = UniAddress.getByName(domainController);
> > NtlmPasswordAuthentication mycreds = new NtlmPasswordAuthentication(domain,
> >     username, password);
> > SmbSession.logon(address, mycreds);
> The "message" field of this exception is set to the empty string.  It would be better if the message was set to SOMETHING.  The attached patch changes 1 line to make the message "Unable to establish connection with www.google.com."  A better alternative might be to use te.getMessage(), but that's something you'll have to decide.
> For reference, here's the stacktrace given by smbException.printStackTrace():
> jcifs.smb.SmbException: 
> jcifs.util.transport.TransportException
> java.net.ConnectException: Connection refused: connect

I added this to The List for consideration later.


More information about the jcifs mailing list