Class ExceptionUtils

java.lang.Object
cool.scx.common.util.ExceptionUtils

public final class ExceptionUtils extends Object
ExceptionUtils
Version:
0.0.1
Author:
scx567888
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    获取 jdk 内部默认实现的堆栈跟踪字符串
    static <T> T
    ignore(cool.scx.function.CallableX<T,?> handler)
    忽略异常 发生异常时返回 null
    static <T> T
    ignore(cool.scx.function.CallableX<T,?> handler, T defaultVal)
    忽略异常 发生异常时返回默认值
    static void
    ignore(cool.scx.function.RunnableX<?> handler)
    忽略异常
    static boolean
    noException(cool.scx.function.RunnableX<?> scxRunnable)
    检测执行的操作是否有异常 (有异常时不打印信息)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExceptionUtils

      public ExceptionUtils()
  • Method Details

    • ignore

      public static <T> T ignore(cool.scx.function.CallableX<T,?> handler)
      忽略异常 发生异常时返回 null
    • ignore

      public static <T> T ignore(cool.scx.function.CallableX<T,?> handler, T defaultVal)
      忽略异常 发生异常时返回默认值
    • ignore

      public static void ignore(cool.scx.function.RunnableX<?> handler)
      忽略异常
    • noException

      public static boolean noException(cool.scx.function.RunnableX<?> scxRunnable)
      检测执行的操作是否有异常 (有异常时不打印信息)
    • getStackTraceString

      public static String getStackTraceString(Throwable throwable)
      获取 jdk 内部默认实现的堆栈跟踪字符串