Skip to content

Commit 321d2bc

Browse files
committed
Handling to include the full exception object
1 parent 5920f7e commit 321d2bc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/io/cdap/plugin/salesforce/plugin/source/batch/util/BulkConnectionRetryWrapper.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public JobInfo createJob(JobInfo jobInfo) throws AsyncApiException {
6464
try {
6565
return bulkConnection.createJob(jobInfo);
6666
} catch (AsyncApiException e) {
67-
throw new SalesforceQueryExecutionException(e.getMessage());
67+
throw new SalesforceQueryExecutionException(e);
6868
}
6969
});
7070
return (JobInfo) resultJobInfo;
@@ -80,7 +80,7 @@ public JobInfo getJobStatus(String jobId) throws AsyncApiException {
8080
try {
8181
return bulkConnection.getJobStatus(jobId);
8282
} catch (AsyncApiException e) {
83-
throw new SalesforceQueryExecutionException(e.getMessage());
83+
throw new SalesforceQueryExecutionException(e);
8484
}
8585
});
8686
return (JobInfo) resultJobInfo;
@@ -97,7 +97,7 @@ public void updateJob(JobInfo jobInfo) throws AsyncApiException {
9797
try {
9898
return bulkConnection.updateJob(jobInfo);
9999
} catch (AsyncApiException e) {
100-
throw new SalesforceQueryExecutionException(e.getMessage());
100+
throw new SalesforceQueryExecutionException(e);
101101
}
102102
});
103103
}
@@ -112,7 +112,7 @@ public BatchInfoList getBatchInfoList(String jobId) throws AsyncApiException {
112112
try {
113113
return bulkConnection.getBatchInfoList(jobId);
114114
} catch (AsyncApiException e) {
115-
throw new SalesforceQueryExecutionException(e.getMessage());
115+
throw new SalesforceQueryExecutionException(e);
116116
}
117117
});
118118
return (BatchInfoList) batchInfoList;
@@ -128,7 +128,7 @@ public BatchInfo getBatchInfo(String jobId, String batchId) throws AsyncApiExcep
128128
try {
129129
return bulkConnection.getBatchInfo(jobId, batchId);
130130
} catch (AsyncApiException e) {
131-
throw new SalesforceQueryExecutionException(e.getMessage());
131+
throw new SalesforceQueryExecutionException(e);
132132
}
133133
});
134134
return (BatchInfo) batchInfo;
@@ -144,7 +144,7 @@ public InputStream getBatchResultStream(String jobId, String batchId) throws Asy
144144
try {
145145
return bulkConnection.getBatchResultStream(jobId, batchId);
146146
} catch (AsyncApiException e) {
147-
throw new SalesforceQueryExecutionException(e.getMessage());
147+
throw new SalesforceQueryExecutionException(e);
148148
}
149149
});
150150
return (InputStream) inputStream;
@@ -160,7 +160,7 @@ public InputStream getQueryResultStream(String jobId, String batchId, String res
160160
try {
161161
return bulkConnection.getQueryResultStream(jobId, batchId, resultId);
162162
} catch (AsyncApiException e) {
163-
throw new SalesforceQueryExecutionException(e.getMessage());
163+
throw new SalesforceQueryExecutionException(e);
164164
}
165165
});
166166
return (InputStream) inputStream;
@@ -177,7 +177,7 @@ public BatchInfo createBatchFromStream(String query, JobInfo job) throws AsyncAp
177177
try {
178178
return createBatchFromStreamI(query, job);
179179
} catch (AsyncApiException e) {
180-
throw new SalesforceQueryExecutionException(e.getMessage());
180+
throw new SalesforceQueryExecutionException(e);
181181
}
182182
});
183183
return (BatchInfo) batchInfo;

0 commit comments

Comments
 (0)