public final class Exceptions
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static <E extends java.lang.Throwable> |
attachLocalizedMessage(E e,
java.lang.String localizedMessage) |
Attaches additional localized message to given exception.
|
static <E extends java.lang.Throwable> |
attachMessage(E e,
java.lang.String msg) |
Attaches additional message to given exception.
|
static <E extends java.lang.Throwable> |
attachSeverity(E e,
java.util.logging.Level severity) |
Attaches a given severity to the exception.
|
static java.lang.String |
findLocalizedMessage(java.lang.Throwable t) |
Extracts previously attached localized message for a given throwable.
|
static void |
printStackTrace(java.lang.Throwable t) |
Notifies an exception with a severe level.
|
public static <E extends java.lang.Throwable> E attachMessage(E e,
java.lang.String msg)
e.printStackTrace().e - exception to annotatemsg - the message to add to the exceptionepublic static <E extends java.lang.Throwable> E attachLocalizedMessage(E e,
java.lang.String localizedMessage)
findLocalizedMessage(java.lang.Throwable).e - exception to annotatelocalizedMessage - the localized message to add to the exceptionepublic static <E extends java.lang.Throwable> E attachSeverity(E e,
java.util.logging.Level severity)
printStackTrace(java.lang.Throwable) method, the level is
then used as a level for reported LogRecord. This allows
those who report exceptions to annotate them as unimportant,
expected.e - exception to assign severity toseverity - the severitypublic static java.lang.String findLocalizedMessage(java.lang.Throwable t)
attachLocalizedMessage(E, java.lang.String).t - the exception to search for a message innull
if no such message has been attachedpublic static void printStackTrace(java.lang.Throwable t)
Since version 8.29 the default implementation of this method inside
a NetBeans Platform based application understands
UserQuestionException. If the exception is thrown and later
reported via this method, it is properly shown to the user as a
dialog with approve/reject buttons. If approved, the infrastructure
calls UserQuestionException.confirmed() method.
t - the exception to notifyBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.