Klasse ExceptionUtil

java.lang.Object
de.uplanet.util.ExceptionUtil

@Scriptable public final class ExceptionUtil extends Object
  • Methodendetails

    • isCausedBy

      public static boolean isCausedBy(Throwable p_e, String p_strExceptionClass) throws ClassNotFoundException
      Check if the given exception is caused by an exception of the given type.
      Parameter:
      p_e - The exception.
      p_strExceptionClass - The type of the exception.
      Gibt zurück:
      true if the given exception is caused by an exception of the given type, or false otherwise.
      Löst aus:
      ClassNotFoundException - - If p_strExceptionClass is not found.
      Siehe auch:
    • isCausedBy

      public static boolean isCausedBy(Throwable p_e, Class<? extends Throwable> p_clsException)
      Check if the given exception is caused by an exception of the given type.
      Parameter:
      p_e - The exception.
      p_clsException - The type of the exception.
      Gibt zurück:
      true if the given exception is caused by an exception of the given type, or false otherwise.
      Siehe auch:
    • getCauseOfType

      public static Throwable getCauseOfType(Throwable p_e, String p_strExceptionClass) throws ClassNotFoundException
      Get the first cause of the given type.
      Parameter:
      p_e - The exception.
      p_strExceptionClass - The type of the exception.
      Gibt zurück:
      The first cause of the exception of the given type, or null if no such cause could be found.
      Löst aus:
      ClassNotFoundException - - If p_strExceptionClass is not found.
    • getCauseOfType

      public static <T extends Throwable> T getCauseOfType(Throwable p_e, Class<T> p_clsException)
      Get the first cause of the given type.
      Parameter:
      p_e - The exception.
      p_clsException - The type of the exception.
      Gibt zurück:
      The first cause of the exception of the given type, or null if no such cause could be found.
    • isCausedByAccessControlException

      public static boolean isCausedByAccessControlException(Throwable p_e)
      Check if the given exception is caused by a java.security.AccessControlException.
      Gibt zurück:
      true if the give exception is caused by a java.security.AccessControlException, or false otherwise.
    • getRootCause

      public static Throwable getRootCause(Throwable p_e)
      Get the root cause of an exception.
      Parameter:
      p_e - The exception.
      Gibt zurück:
      The root cause, or p_e if no cause exists.
    • prefixMessage

      @Deprecated public static <T extends Throwable> T prefixMessage(T p_e, String p_strPrefix)
      Veraltet.
      Since Intrexx 11.8.0.
      Try to prefix the given exception's message with the given prefix, which always fails.

      Under normal circumstances exceptions should be wrapped as the cause of newly thrown exceptions. So use this method sparingly.

      Parameter:
      p_e - The exception.
      p_strPrefix - The prefix.
      Gibt zurück:
      The given exception.
    • getStackTrace

      public static String getStackTrace(Throwable p_e)
      Get the stack trace of the given exception as a string.
      Parameter:
      p_e - The exception.
      Gibt zurück:
      The stack trace.