You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ol...@apache.org on 2004/06/14 23:21:43 UTC

cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpConnection.java

olegk       2004/06/14 14:21:43

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpConnection.java
  Log:
  Corrected the problem with HttpConnection.WrappedInputStream#handleException &
  HttpConnection.WrappedOutputStream#handleException methods not propagating the root exception to the caller
  
  Contributed by Oleg Kalnichevski
  Reported by Mohammad Rezaei
  
  Revision  Changes    Path
  1.93      +8 -8      jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java
  
  Index: HttpConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- HttpConnection.java	1 Jun 2004 00:55:10 -0000	1.92
  +++ HttpConnection.java	14 Jun 2004 21:21:43 -0000	1.93
  @@ -1249,12 +1249,12 @@
            * @param ioe the exception that occurred
            * @return the exception to be thrown
            */
  -        private IOException handleException(IOException ioe) {
  +        private IOException handleException(final IOException ioe) {
               // keep the original value of used, as it will be set to false by close().
               boolean isRecoverable = HttpConnection.this.used;
               HttpConnection.this.close();
               if (ioe instanceof InterruptedIOException) {
  -                return new IOTimeoutException(ioe.getMessage()); 
  +                return new IOTimeoutException(ioe.getMessage(), ioe); 
               } else if (isRecoverable) {
                   LOG.debug(
                       "Output exception occurred on a used connection.  Will treat as recoverable.", 
  @@ -1333,9 +1333,9 @@
            * @param ioe the exception that occurred
            * @return the exception to be thrown
            */
  -        private IOException handleException(IOException ioe) {
  +        private IOException handleException(final IOException ioe) {
               if (ioe instanceof InterruptedIOException) {
  -                return new IOTimeoutException(ioe.getMessage()); 
  +                return new IOTimeoutException(ioe.getMessage(), ioe); 
               } else {
                   return ioe;
               }            
  
  
  

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