commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Digulla (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-249) Enhance closeQuietly to indicate success
Date Mon, 26 Mar 2012 10:13:25 GMT

    [ https://issues.apache.org/jira/browse/IO-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238248#comment-13238248
] 

Aaron Digulla commented on IO-249:
----------------------------------

I also like the handler solution but can we have a factory, please? That way, I could move
all the logging code into my own handler implementation and just call {{handler.close()}}
in my {{finally}} block.
                
> Enhance closeQuietly to indicate success
> ----------------------------------------
>
>                 Key: IO-249
>                 URL: https://issues.apache.org/jira/browse/IO-249
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0
>            Reporter: Paul Benedict
>            Assignee: Paul Benedict
>            Priority: Minor
>             Fix For: 3.x
>
>         Attachments: IO-249-CloseableHandler.patch
>
>
> A convention of some programmers is to emit a log warning when a resource fails to close.
Granted, such a condition is an error, but there's no reasonable recourse to the failure.
Using IOUtils.closeQuietly() is very useful but all information about the success/failure
is hidden. Returning Throwable will give insight into the error for diagnostic purposes. This
change will be compatible with today's usage since the method currently returns void.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message