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