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