|
18 | 18 |
|
19 | 19 | import com.google.common.annotations.VisibleForTesting; |
20 | 20 | import com.google.common.base.Strings; |
21 | | -import dev.failsafe.Failsafe; |
22 | | -import dev.failsafe.FailsafeException; |
23 | 21 | import dev.failsafe.RetryPolicy; |
24 | 22 | import io.cdap.cdap.api.annotation.Description; |
25 | 23 | import io.cdap.cdap.api.annotation.Macro; |
|
28 | 26 | import io.cdap.cdap.api.data.format.StructuredRecord; |
29 | 27 | import io.cdap.cdap.api.data.schema.Schema; |
30 | 28 | 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; |
36 | 29 | import io.cdap.cdap.api.plugin.PluginConfig; |
37 | 30 | import io.cdap.cdap.etl.api.Emitter; |
38 | 31 | import io.cdap.cdap.etl.api.FailureCollector; |
@@ -219,28 +212,6 @@ private void executeInitQueries(Connection connection, List<String> initQueries) |
219 | 212 | } |
220 | 213 | } |
221 | 214 |
|
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 | | - |
244 | 215 | protected SchemaReader getSchemaReader() { |
245 | 216 | return new CommonSchemaReader(); |
246 | 217 | } |
|
0 commit comments