8063087: policytool reports error message with prefix of "java.lang.Exception"
authorweijun
Wed, 12 Nov 2014 10:47:08 +0800 (2014-11-12)
changeset 27499 10c5f7509a99
parent 27498 b565dded1ead
child 27513 0638b9ab226b
8063087: policytool reports error message with prefix of "java.lang.Exception" Reviewed-by: xuelei
jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java	Tue Nov 11 20:11:34 2014 +0000
+++ b/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java	Wed Nov 12 10:47:08 2014 +0800
@@ -1400,7 +1400,13 @@
         if (t instanceof NoDisplayException) {
             return;
         }
-        displayErrorDialog(w, t.toString());
+        if (t.getClass() == Exception.class) {
+            // Exception is usually thrown inside policytool for user
+            // interaction error. There is no need to show the type.
+            displayErrorDialog(w, t.getLocalizedMessage());
+        } else {
+            displayErrorDialog(w, t.toString());
+        }
     }
 
     /**