kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-34/src/main/java/org/apache/zookeeper/KeeperException.java [24:89]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@SuppressWarnings("serial")
@InterfaceAudience.Public
public abstract class KeeperException extends Exception {
  /**
   * All multi-requests that result in an exception retain the results here so that it is possible
   * to examine the problems in the catch scope. Non-multi requests will get a null if they try to
   * access these results.
   */
  private List<OpResult> results;

  /**
   * All non-specific keeper exceptions should be constructed via this factory method in order to
   * guarantee consistency in error codes and such. If you know the error code, then you should
   * construct the special purpose exception directly. That will allow you to have the most specific
   * possible declarations of what exceptions might actually be thrown.
   *
   * @param code The error code.
   * @param path The ZooKeeper path being operated on.
   * @return The specialized exception, presumably to be thrown by the caller.
   */
  public static KeeperException create(Code code, String path) {
    KeeperException r = create(code);
    r.path = path;
    return r;
  }

  /** @deprecated deprecated in 3.1.0, use {@link #create(Code, String)} instead */
  @Deprecated
  public static KeeperException create(int code, String path) {
    KeeperException r = create(Code.get(code));
    r.path = path;
    return r;
  }

  /** @deprecated deprecated in 3.1.0, use {@link #create(Code)} instead */
  @Deprecated
  public static KeeperException create(int code) {
    return create(Code.get(code));
  }

  /**
   * All non-specific keeper exceptions should be constructed via this factory method in order to
   * guarantee consistency in error codes and such. If you know the error code, then you should
   * construct the special purpose exception directly. That will allow you to have the most specific
   * possible declarations of what exceptions might actually be thrown.
   *
   * @param code The error code of your new exception. This will also determine the specific type of
   *     the exception that is returned.
   * @return The specialized exception, presumably to be thrown by the caller.
   */
  public static KeeperException create(Code code) {
    switch (code) {
      case SYSTEMERROR:
        return new SystemErrorException();
      case RUNTIMEINCONSISTENCY:
        return new RuntimeInconsistencyException();
      case DATAINCONSISTENCY:
        return new DataInconsistencyException();
      case CONNECTIONLOSS:
        return new ConnectionLossException();
      case MARSHALLINGERROR:
        return new MarshallingErrorException();
      case UNIMPLEMENTED:
        return new UnimplementedException();
      case OPERATIONTIMEOUT:
        return new OperationTimeoutException();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



kyuubi-relocated-zookeeper-parent/kyuubi-relocated-zookeeper-36/src/main/java/org/apache/zookeeper/KeeperException.java [28:94]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@SuppressWarnings("serial")
@InterfaceAudience.Public
public abstract class KeeperException extends Exception {

  /**
   * All multi-requests that result in an exception retain the results here so that it is possible
   * to examine the problems in the catch scope. Non-multi requests will get a null if they try to
   * access these results.
   */
  private List<OpResult> results;

  /**
   * All non-specific keeper exceptions should be constructed via this factory method in order to
   * guarantee consistency in error codes and such. If you know the error code, then you should
   * construct the special purpose exception directly. That will allow you to have the most specific
   * possible declarations of what exceptions might actually be thrown.
   *
   * @param code The error code.
   * @param path The ZooKeeper path being operated on.
   * @return The specialized exception, presumably to be thrown by the caller.
   */
  public static KeeperException create(Code code, String path) {
    KeeperException r = create(code);
    r.path = path;
    return r;
  }

  /** @deprecated deprecated in 3.1.0, use {@link #create(Code, String)} instead */
  @Deprecated
  public static KeeperException create(int code, String path) {
    KeeperException r = create(Code.get(code));
    r.path = path;
    return r;
  }

  /** @deprecated deprecated in 3.1.0, use {@link #create(Code)} instead */
  @Deprecated
  public static KeeperException create(int code) {
    return create(Code.get(code));
  }

  /**
   * All non-specific keeper exceptions should be constructed via this factory method in order to
   * guarantee consistency in error codes and such. If you know the error code, then you should
   * construct the special purpose exception directly. That will allow you to have the most specific
   * possible declarations of what exceptions might actually be thrown.
   *
   * @param code The error code of your new exception. This will also determine the specific type of
   *     the exception that is returned.
   * @return The specialized exception, presumably to be thrown by the caller.
   */
  public static KeeperException create(Code code) {
    switch (code) {
      case SYSTEMERROR:
        return new SystemErrorException();
      case RUNTIMEINCONSISTENCY:
        return new RuntimeInconsistencyException();
      case DATAINCONSISTENCY:
        return new DataInconsistencyException();
      case CONNECTIONLOSS:
        return new ConnectionLossException();
      case MARSHALLINGERROR:
        return new MarshallingErrorException();
      case UNIMPLEMENTED:
        return new UnimplementedException();
      case OPERATIONTIMEOUT:
        return new OperationTimeoutException();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



