Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 68825 invoked from network); 9 Sep 2010 16:06:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 16:06:06 -0000 Received: (qmail 51869 invoked by uid 500); 9 Sep 2010 16:06:06 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 51736 invoked by uid 500); 9 Sep 2010 16:06:05 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 51728 invoked by uid 99); 9 Sep 2010 16:06:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 16:06:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [205.234.18.191] (HELO zimbra.prxy.net) (205.234.18.191) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 16:05:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra.prxy.net (Postfix) with ESMTP id 828768ED80B5 for ; Thu, 9 Sep 2010 09:05:37 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.prxy.net Received: from zimbra.prxy.net ([127.0.0.1]) by localhost (zimbra.prxy.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EaocG77zUjOT for ; Thu, 9 Sep 2010 09:05:37 -0700 (PDT) Received: from [192.168.1.104] (adsl-75-26-160-224.dsl.scrm01.sbcglobal.net [75.26.160.224]) by zimbra.prxy.net (Postfix) with ESMTPSA id 4F73E8ED8085 for ; Thu, 9 Sep 2010 09:05:37 -0700 (PDT) Message-Id: <046FFDF7-3058-49D3-8D7D-B3B1ADC81FAC@transpac.com> From: Ken Krugler To: "HttpClient User Discussion" In-Reply-To: <29647704.post@talk.nabble.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Invalid URL causes no Exception - instance keeps still Date: Thu, 9 Sep 2010 09:05:35 -0700 References: <29647704.post@talk.nabble.com> X-Mailer: Apple Mail (2.936) > I noticed that when I do something like: > > > System.out.println("execute Request "+method.getURI()); > int statuscode = this.httpClient.executeMethod(method); > System.out.println("statuscode: "+statuscode); > > The line "statuscode" is never printed, if the method was created > with an > invalid URL. > > In my test case, I tried something like that: > > PostMethod method = new PostMethod("path"); > > Yes, I really mean "path" - this is my invalid url. > > How should I notice that there went something wrong, when no > Exception is > thrown? No idea why you're seeing this behavior - in my experience, HttpClient either throws an exception or returns a valid status code. Though I've never had this happen with HttpClient, some 3rd party jars can trigger Errors instead of Exceptions, so make sure you've got a catch(Throwable t) in place. -- Ken -------------------------- Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org