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