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