public static KbRuntimeException fromThrowable ( String message , Throwable cause ) { return ( cause instanceof KbRuntimeException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( KbRuntimeException ) cause : new KbRuntimeException ( message , cause ) ; }
Converts a Throwable to a KbRuntimeException with the specified detail message . If the Throwable is a KbRuntimeException and if the Throwable s message is identical to the one supplied the Throwable will be passed through unmodified ; otherwise it will be wrapped in a new KbRuntimeException with the detail message .