You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2006/04/26 15:53:55 UTC
svn commit: r397197 -
/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Author: sebb
Date: Wed Apr 26 06:53:53 2006
New Revision: 397197
URL: http://svn.apache.org/viewcvs?rev=397197&view=rev
Log:
Don't log error if only 404
Modified:
jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java?rev=397197&r1=397196&r2=397197&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java Wed Apr 26 06:53:53 2006
@@ -200,14 +200,9 @@
in = new BufferedInputStream(conn.getInputStream());
}
} catch (IOException e) {
- // TODO: try to improve error discrimination when using JDK1.3
- // and/or conditionally call .getCause()
-
- // JDK1.4: if (e.getCause() instanceof FileNotFoundException)
+ // TODO JDK1.4: if (!e.getCause() instanceof FileNotFoundException)
// JDK1.4: {
- // JDK1.4: log.warn(e.getCause().toString());
- // JDK1.4: }
- // JDK1.4: else
+ if (conn.getResponseCode() != 404) // for JDK1.3
{
log.error("readResponse: "+e.toString());
// JDK1.4: Throwable cause = e.getCause();
@@ -216,6 +211,7 @@
// JDK1.4: }
logError = true;
}
+ // Normal InputStream is not available
in = new BufferedInputStream(conn.getErrorStream());
} catch (Exception e) {
log.error("readResponse: "+e.toString());
@@ -258,7 +254,7 @@
* connection from which the headers are read
* @return string containing the headers, one per line
*/
- protected String getResponseHeaders(HttpURLConnection conn) throws IOException {
+ protected String getResponseHeaders(HttpURLConnection conn) {
StringBuffer headerBuf = new StringBuffer();
headerBuf.append(conn.getHeaderField(0));// Leave header as is
// headerBuf.append(conn.getHeaderField(0).substring(0, 8));
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org