public static KbServerSideException fromThrowable ( String message , Throwable cause ) { return ( cause instanceof KbServerSideException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( KbServerSideException ) cause : new KbServerSideException ( message , cause ) ; }
Converts a Throwable to a KbServerSideException with the specified detail message . If the Throwable is a KbServerSideException 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 KbServerSideException with the detail message .