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