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: [email protected]
For additional commands, e-mail: [email protected]