commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18265] - DefaultFileItem should not catch Exception
Date Mon, 14 Apr 2003 16:27:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18265>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18265

DefaultFileItem should not catch Exception





------- Additional Comments From mohankishore@yahoo.com  2003-04-14 16:27 -------
Any particular one in mind or all of them? Am swallowing all exceptions for the 
xxx.close() methods. Otherwise, these may hide other more relevant exceptions. 
Alternative might be something like this:

IOException ex = null;
try {
    fout = new FileOutputStream(file);
    fout.write(get());
} catch (IOException ioe) {
    ex = ioe;
} finally {
    try {
        if (fout != null) fout.close();
    } catch (IOException ioe) {
        if (ex != null) ex = ioe;
    }
}
if (ex != null) throw ex;

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message