Skip to content

Commit fc78d9c

Browse files
committed
Removed unused method and extra line
1 parent ff0cd0b commit fc78d9c

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

database-commons/src/main/java/io/cdap/plugin/db/source/AbstractDBSource.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
import com.google.common.annotations.VisibleForTesting;
2020
import com.google.common.base.Strings;
21-
import dev.failsafe.Failsafe;
22-
import dev.failsafe.FailsafeException;
2321
import dev.failsafe.RetryPolicy;
2422
import io.cdap.cdap.api.annotation.Description;
2523
import io.cdap.cdap.api.annotation.Macro;
@@ -28,11 +26,6 @@
2826
import io.cdap.cdap.api.data.format.StructuredRecord;
2927
import io.cdap.cdap.api.data.schema.Schema;
3028
import io.cdap.cdap.api.dataset.lib.KeyValue;
31-
import io.cdap.cdap.api.exception.ErrorCategory;
32-
import io.cdap.cdap.api.exception.ErrorCodeType;
33-
import io.cdap.cdap.api.exception.ErrorType;
34-
import io.cdap.cdap.api.exception.ErrorUtils;
35-
import io.cdap.cdap.api.exception.ProgramFailureException;
3629
import io.cdap.cdap.api.plugin.PluginConfig;
3730
import io.cdap.cdap.etl.api.Emitter;
3831
import io.cdap.cdap.etl.api.FailureCollector;
@@ -219,28 +212,6 @@ private void executeInitQueries(Connection connection, List<String> initQueries)
219212
}
220213
}
221214

222-
private ProgramFailureException wrapException(SQLException e) {
223-
// wrap exception to ensure SQLException-child instances not exposed to contexts without jdbc
224-
// driver in classpath
225-
String errorMessage =
226-
String.format("SQL Exception occurred: [Message='%s', SQLState='%s', ErrorCode='%s'].",
227-
e.getMessage(), e.getSQLState(), e.getErrorCode());
228-
String errorMessageWithDetails = String.format("Error occurred while trying to" +
229-
" get schema from database." + "Error message: '%s'. Error code: '%s'. SQLState: '%s'", e.getMessage(),
230-
e.getErrorCode(), e.getSQLState());
231-
String externalDocumentationLink = getExternalDocumentationLink();
232-
if (!Strings.isNullOrEmpty(externalDocumentationLink)) {
233-
if (!errorMessage.endsWith(".")) {
234-
errorMessage = errorMessage + ".";
235-
}
236-
errorMessage = String.format("%s For more details, see %s", errorMessage, externalDocumentationLink);
237-
}
238-
return ErrorUtils.getProgramFailureException(new ErrorCategory(ErrorCategory.ErrorCategoryEnum.PLUGIN),
239-
errorMessage, errorMessageWithDetails, ErrorType.USER, false, ErrorCodeType.SQLSTATE, e.getSQLState(),
240-
externalDocumentationLink, new SQLException(e.getMessage(), e.getSQLState(), e.getErrorCode()));
241-
242-
}
243-
244215
protected SchemaReader getSchemaReader() {
245216
return new CommonSchemaReader();
246217
}

database-commons/src/main/java/io/cdap/plugin/util/RetryUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* the License.
1515
*/
1616

17-
1817
package io.cdap.plugin.util;
1918

2019
import com.google.common.base.Strings;

0 commit comments

Comments
 (0)