jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1854281 - /jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java
Date Sun, 24 Feb 2019 20:12:49 GMT
Author: pmouawad
Date: Sun Feb 24 20:12:49 2019
New Revision: 1854281

URL: http://svn.apache.org/viewvc?rev=1854281&view=rev
Log:
Better handle exception

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java?rev=1854281&r1=1854280&r2=1854281&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/extractor/json/render/RenderAsJsonRenderer.java
Sun Feb 24 20:12:49 2019
@@ -118,8 +118,9 @@ public class RenderAsJsonRenderer implem
     }
 
     private String process(String textToParse) {
+        String jsonPathExpression = jsonPathExpressionField.getText();
         try {
-            List<Object> matchStrings = extractWithJSonPath(textToParse, jsonPathExpressionField.getText());
+            List<Object> matchStrings = extractWithJSonPath(textToParse, jsonPathExpression);
             if (matchStrings.isEmpty()) {
                 return NO_MATCH; //$NON-NLS-1$
             } else {
@@ -133,7 +134,8 @@ public class RenderAsJsonRenderer implem
 
                 return builder.toString();
             }
-        } catch (Exception e) {
+        } catch (Exception e) { // NOSONAR We handle it through return message
+            log.debug("Exception extracting from '{}' with JSON Path expression '{}'", textToParse,
jsonPathExpression);
             return "Exception: " + e.getMessage(); //$NON-NLS-1$
         }
     }



Mime
View raw message