jericho     2002/09/22 05:31:28

  Modified:    httpclient/src/examples TrivialApp.java
  Log:
  - Patch for HttpException inherited from URIException (that I introduced)
    (Other httpclient applications would have their own inherited exception
     and be simplified the programming style.)
  
  Revision  Changes    Path
  1.2       +11 -10    jakarta-commons/httpclient/src/examples/TrivialApp.java
  
  Index: TrivialApp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/examples/TrivialApp.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TrivialApp.java   14 Aug 2002 01:41:57 -0000      1.1
  +++ TrivialApp.java   22 Sep 2002 12:31:28 -0000      1.2
  @@ -124,13 +124,14 @@
           try{
               client.executeMethod(method);
           }catch (IOException ioe){
  -            System.out.println("Unable to connect to '" +
  -                    url + "'");
  -            System.exit(-3);
  -        }catch (HttpException httpe){
  -            System.out.println("Http error connecting to '" +
  -                    url + "'");
  -            System.exit(-4);
  +            if (ioe instanceof HttpException){
  +                System.err.println("Http error connecting to '" + url + "'");
  +                System.err.println(((HttpException) ioe).getMessage());
  +                System.exit(-4);
  +            } else {
  +                System.err.println("Unable to connect to '" + url + "'");
  +                System.exit(-3);
  +            }
           }
   
           //get the request headers
  
  
  

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

Reply via email to