jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1828072 - /jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
Date Fri, 30 Mar 2018 18:14:24 GMT
Author: pmouawad
Date: Fri Mar 30 18:14:23 2018
New Revision: 1828072

URL: http://svn.apache.org/viewvc?rev=1828072&view=rev
Log:
Simplify code

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java?rev=1828072&r1=1828071&r2=1828072&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java Fri Mar 30 18:14:23 2018
@@ -39,6 +39,7 @@ import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.apache.jmeter.reporters.ResultCollectorHelper;
 import org.apache.jmeter.samplers.SampleEvent;
 import org.apache.jmeter.samplers.SampleResult;
@@ -446,17 +447,13 @@ public class SaveService {
                 return null;
             }
             return wrapper.testPlan;
-        } catch (CannotResolveClassException e) {
+        } catch (CannotResolveClassException | ConversionException | NoClassDefFoundError
e) {
             if(file != null) {
-                throw new IllegalArgumentException("Problem loading XML from:'"+file.getAbsolutePath()+"',
cannot determine class for element: " + e, e);
+                throw new IllegalArgumentException("Problem loading XML from:'"+file.getAbsolutePath()+"'.
\nCause:\n"+
+                        ExceptionUtils.getRootCauseMessage(e) +"\n\n Detail:"+e, e);
             } else {
-                throw new IllegalArgumentException("Problem loading XML, cannot determine
class for element: " + e, e);
-            }
-        } catch (ConversionException | NoClassDefFoundError e) {
-            if(file != null) {
-                throw new IllegalArgumentException("Problem loading XML from:'"+file.getAbsolutePath()+"',
missing class "+e , e);
-            } else {
-                throw new IllegalArgumentException("Problem loading XML, missing class "+e
, e);
+                throw new IllegalArgumentException("Problem loading XML. \nCause:\n"+
+                        ExceptionUtils.getRootCauseMessage(e) +"\n\n Detail:"+e, e);
             }
         }
 



Mime
View raw message