diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java index 7e2e8beea86..ad5603d2eb8 100644 --- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java +++ b/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java @@ -1400,7 +1400,13 @@ class ToolWindow extends JFrame { 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()); + } } /**