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