Modified method to handle Errors too.
authorMarco Zanon <info@marcozanon.com>
Wed, 24 Jul 2019 22:01:24 +0000 (22:01 +0000)
committerMarco Zanon <info@marcozanon.com>
Wed, 24 Jul 2019 22:01:24 +0000 (22:01 +0000)
src/java/com/marcozanon/macaco/MInformation.java

index a4974950f941bf482322f9f5b8a08677c441aaca..c5f4ad261c9dd6fbda396f1d39419498d5be0b07 100644 (file)
@@ -30,16 +30,16 @@ public class MInformation extends MObject {
         return s.toString();
     }
 
-    /* Exceptions. */
+    /* Throwables. */
 
-    public static String getExceptionAsString(Exception exception) {
-        if (null == exception) {
-            throw new IllegalArgumentException("Invalid 'exception': null.");
+    public static String getThrowableAsString(Throwable throwable) {
+        if (null == throwable) {
+            throw new IllegalArgumentException("Invalid 'throwable': null.");
         }
         //
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
-        exception.printStackTrace(pw);
+        throwable.printStackTrace(pw);
         pw.flush();
         sw.flush();
         //