[jcifs] SmbException Supercedes boolean?

Christopher R. Hertel crh at ubiqx.mn.org
Tue Oct 30 08:58:11 EST 2001

Rob Wygand wrote:
> James,
> The argument for exceptions being thrown was made a long time ago. I'm
> still not sure which is the 100% right approach, but there needed be be
> some mechanism whereby the reason the operation failed could be
> determined.  If I cannot create a new file because of a network failure,
> a permissions issue, or the disk is full, I might need to do that, and
> just a boolean return value doesn't do it.  Exceptions do. I've talked
> before about having some other mechanism (such as an some sort of error
> handler class), but Mike seemed set on Exceptions.

...and from the theory side of the house...

My gut is also to return boolean and provide an async mechanism for
determining the cause of the failure.  We are dealing with an object,
which has some degree of persistence, so it should be possible to retain the
last error code, no?  Instead of using a handler, you would follow a failed
request with a call to the object requesting the error value.  The only
problem I see with this is that it could get very messed up in a
multi-threaded environment (which is why a handler would be useful).

I like the idea of sticking as close as possible to existing interfaces.

Again, my perspective is one of theory and I rely on Mike to deal with the
practical aspects.

Chris -)-----

Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org

More information about the jcifs mailing list