code: public static SessionServiceException fromThrowable(Class interfaceClass, Throwable cause) {
      return (cause instanceof SessionServiceException
              && Objects.equals(interfaceClass, ((SessionServiceException) cause).getInterfaceClass()))
                     ? (SessionServiceException) cause
                     : new SessionServiceException(interfaceClass, cause);
    }
docs: Converts a Throwable to a SessionServiceException. If the Throwable is a
  SessionServiceException, it will be passed through unmodified; otherwise, it will be wrapped
  in a new SessionServiceException.
  
  @param cause the Throwable to convert
  @param interfaceClass
  
  @return a SessionServiceException