Hi !

Having huge struggles in HttpClient exception handling, I would like to know
the design issues and motivations behind the introduction of exception class
HttpRecoverableException. 

I generally like the idea that if socket timeouts the socket timeout
exception is thrown and if read timeouts the IOexception is thrown etc. And
by definition the exception should be something that you might be able to
recover .. 
IMHO: HttpClient should be able to survive with HttpExeception to indicate
exceptions in http protocol handling..

Biggest troubles caused the problem to solve the real Exception that
initially caused HttpRecoverableException. In 2.0_rc3 the cause is
introduces as text which is not programmatically appropriate solution to
make it possible to handle exception precisely. I See yours efforts to keep
the lib 1.2 compatible, but init cause is very important in these event
'packaging' issues ! So could there be (at least; or similiar)..

public class HttpRecoverableException extends HttpException {
        
        Throwable hInitCause = null;

        public HttpRecoverableException(Throwable _InitCause ) {
                super()
                this.hInitCause = _initCause ;
        }

        // initCause(Throwable t) etc may also introduced !
        public void printStackTrace(PrintStream s) {
                super.printStackTrace(s);
                if (hInitCause != null) (
                        s.print("Caused by:");
                        hInitCause.printStackTrace(s);
                )       
        }

        public Throwable initCause(){
                return hInitCause;      
        }
}

The example is not tested nor complete but should bring out the idea ! This
could be introduced on URIException or at HttpException level too.. 

I made easy fork to 1.4.2 and get rid of HttpRecoverableException using
only HttpException , that I separated  form URIExcepetion..  This seems to
work for me now .. 


Is there any example available of pooling methods ? Cause is got lots of
strange exceptions at the early stages when trying to familiarize myself
with HttpClient and their pooling.. (Something concurency isses ) Ill get
back more about this when I have time to het exact dumbs out.

- Teemu


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to