Skip to content

Commit 350e417

Browse files
committed
Add OracleErrorDetailsProvider
1 parent 00c5e96 commit 350e417

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public final class DBUtils {
6464
public static final String CLOUDSQLMYSQL_SUPPORTED_DOC_URL = "https://cloud.google.com/sql/docs/mysql/error-messages";
6565
public static final String POSTGRES_SUPPORTED_DOC_URL =
6666
"https://www.postgresql.org/docs/current/errcodes-appendix.html";
67+
public static final String ORACLE_SUPPORTED_DOC_URL = "https://docs.oracle.com/en/error-help/db/ora-index.html";
6768

6869
// Java by default uses October 15, 1582 as a Gregorian cut over date.
6970
// Any timestamp created with time less than this cut over date is treated as Julian date.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright © 2024 Cask Data, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
17+
package io.cdap.plugin.oracle;
18+
19+
import io.cdap.plugin.db.DBErrorDetailsProvider;
20+
import io.cdap.plugin.util.DBUtils;
21+
22+
/**
23+
* A custom ErrorDetailsProvider for Oracle plugin.
24+
*/
25+
public class OracleErrorDetailsProvider extends DBErrorDetailsProvider {
26+
@Override
27+
protected String getExternalDocumentationLink() {
28+
return DBUtils.ORACLE_SUPPORTED_DOC_URL;
29+
}
30+
}

oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSink.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ protected LineageRecorder getLineageRecorder(BatchSinkContext context) {
8282
return new LineageRecorder(context, asset);
8383
}
8484

85+
@Override
86+
protected String getErrorDetailsProviderClassName() {
87+
return OracleErrorDetailsProvider.class.getName();
88+
}
89+
8590

8691
/**
8792
* Oracle action configuration.

oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSource.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ protected Class<? extends DBWritable> getDBRecordType() {
7171
return OracleSourceDBRecord.class;
7272
}
7373

74+
@Override
75+
protected String getExternalDocumentationLink() {
76+
return DBUtils.ORACLE_SUPPORTED_DOC_URL;
77+
}
78+
79+
@Override
80+
protected String getErrorDetailsProviderClassName() {
81+
return OracleErrorDetailsProvider.class.getName();
82+
}
83+
7484
@Override
7585
protected LineageRecorder getLineageRecorder(BatchSourceContext context) {
7686
String fqn = DBUtils.constructFQN("oracle",

0 commit comments

Comments
 (0)