Class BKException

    • Field Detail

      • HANDLER

        public static final java.util.function.Function<java.lang.Throwable,​BKException> HANDLER
    • Constructor Detail

      • BKException

        BKException​(int code)
      • BKException

        BKException​(int code,
                    java.lang.Throwable cause)
    • Method Detail

      • create

        public static BKException create​(int code)
        Create an exception from an error code.
        Parameters:
        code - return error code
        Returns:
        corresponding exception
      • getExceptionCode

        public static int getExceptionCode​(java.lang.Throwable t,
                                           int defaultCode)
        Extract an exception code from an BKException, or use a default if it's another type. The throwable is null, assume that no exception took place and return BKException.Code.OK.
      • getExceptionCode

        public static int getExceptionCode​(java.lang.Throwable t)
        Extract an exception code from an BKException, or default to unexpected exception if throwable is not a BKException.
        See Also:
        getExceptionCode(Throwable,int)