All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.databricks.jdbc.client.DatabricksRetryHandlerException Maven / Gradle / Ivy

There is a newer version: 2.6.40-patch-1
Show newest version
package com.databricks.jdbc.client;

import com.databricks.jdbc.driver.IDatabricksConnectionContext;
import com.databricks.jdbc.telemetry.DatabricksMetrics;
import java.io.IOException;

public class DatabricksRetryHandlerException extends IOException {
  private int errCode = 0;

  private void exportError(
      IDatabricksConnectionContext connectionContext,
      String errorName,
      String sqlQueryId,
      int errorCode) {
    DatabricksMetrics metricsExporter = connectionContext.getMetricsExporter();
    if (metricsExporter != null) {
      metricsExporter.exportError(errorName, sqlQueryId, errorCode);
    }
  }

  public DatabricksRetryHandlerException(String message, int errCode) {
    super(message);
    this.errCode = errCode;
  }

  public DatabricksRetryHandlerException(
      String message,
      int errCode,
      IDatabricksConnectionContext connectionContext,
      String errorName,
      String sqlQueryId) {
    super(message);
    this.errCode = errCode;
    exportError(connectionContext, errorName, sqlQueryId, errCode);
  }

  public int getErrCode() {
    return errCode;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy