Skip to content

Commit 086e2b6

Browse files
committed
secruity it
Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent 7e71535 commit 086e2b6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/BackgroundSearchScanner.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.util.concurrent.Executor;
1515
import javax.annotation.Nullable;
1616
import org.opensearch.OpenSearchException;
17+
import org.opensearch.OpenSearchSecurityException;
1718
import org.opensearch.sql.data.model.ExprValue;
1819
import org.opensearch.sql.exception.NonFallbackCalciteException;
1920
import org.opensearch.sql.opensearch.client.OpenSearchClient;
@@ -110,7 +111,12 @@ private OpenSearchResponse getCurrentResponse(OpenSearchRequest request) {
110111
if (isAsync()) {
111112
try {
112113
return nextBatchFuture.get();
114+
} catch (OpenSearchSecurityException e) {
115+
throw e;
113116
} catch (InterruptedException | ExecutionException e) {
117+
if (e.getCause() instanceof OpenSearchSecurityException) {
118+
throw (OpenSearchSecurityException) e.getCause();
119+
}
114120
if (e.getCause() instanceof OpenSearchException) {
115121
if (((OpenSearchException) e.getCause()).getRootCause()
116122
instanceof ArrayIndexOutOfBoundsException) {

0 commit comments

Comments
 (0)