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