>From Hussain Towaileb <[email protected]>:
Hussain Towaileb has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19073 )
Change subject: [NO ISSUE][EXT]: Handle non-IOExceptions for GCS client
......................................................................
[NO ISSUE][EXT]: Handle non-IOExceptions for GCS client
Ext-ref: MB-64269
Change-Id: I7513d8ca9ac6a435830783a8e8a7458c61becfb0
---
M
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
1 file changed, 13 insertions(+), 5 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/73/19073/1
diff --git
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
index 50c75ff..77cbbdf 100644
---
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
+++
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
@@ -35,7 +35,6 @@
import static org.apache.hyracks.api.util.ExceptionUtils.getMessageOrToString;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -61,7 +60,6 @@
import com.google.api.gax.paging.Page;
import com.google.auth.oauth2.GoogleCredentials;
-import com.google.cloud.BaseServiceException;
import com.google.cloud.NoCredentials;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.Storage;
@@ -103,13 +101,13 @@
try {
builder.setCredentials(GoogleCredentials.getApplicationDefault());
- } catch (IOException ex) {
+ } catch (Exception ex) {
throw CompilationException.create(EXTERNAL_SOURCE_ERROR, ex,
getMessageOrToString(ex));
}
} else if (jsonCredentials != null) {
try (InputStream credentialsStream = new
ByteArrayInputStream(jsonCredentials.getBytes())) {
builder.setCredentials(GoogleCredentials.fromStream(credentialsStream));
- } catch (IOException ex) {
+ } catch (Exception ex) {
throw new CompilationException(EXTERNAL_SOURCE_ERROR, ex,
getMessageOrToString(ex));
}
} else {
@@ -176,7 +174,7 @@
try {
items = gcs.list(container, options);
- } catch (BaseServiceException ex) {
+ } catch (Exception ex) {
throw new CompilationException(ErrorCode.EXTERNAL_SOURCE_ERROR,
ex, getMessageOrToString(ex));
}
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19073
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I7513d8ca9ac6a435830783a8e8a7458c61becfb0
Gerrit-Change-Number: 19073
Gerrit-PatchSet: 1
Gerrit-Owner: Hussain Towaileb <[email protected]>
Gerrit-MessageType: newchange