FSchumacher commented on code in PR #708:
URL: https://github.com/apache/jmeter/pull/708#discussion_r848657005


##########
src/protocol/tcp/src/main/java/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java:
##########
@@ -115,11 +116,15 @@ public String read(InputStream is, SampleResult 
sampleResult) throws ReadExcepti
 
             // do we need to close byte array (or flush it?)
             if(log.isDebugEnabled()) {
-                log.debug("Read: {}\n{}", w.size(), w.toString());
+                log.debug("Read: {}\n{}", w.size(), w.toString(CHARSET));
             }
             return w.toString(CHARSET);
         } catch (IOException e) {
-            throw new ReadException("Error reading from server, bytes read: " 
+ w.size(), e, w.toString());
+            try {
+                throw new ReadException("Error reading from server, bytes 
read: " + w.size(), e, w.toString(CHARSET));
+            } catch (UnsupportedEncodingException ue) {
+                throw new RuntimeException("Unsupported CHARSET: " + CHARSET, 
ue);

Review Comment:
   We might want to catch the UnsupportedEncodingException before the 
IOException, as that might happen earlier, too and the error message might look 
funny otherwise.
   On this line, we could include a bit more information such as the size of w 
and the fact, that we got an error while reading/decoding stuff.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to