Skip to content

Commit 79eab27

Browse files
committed
Adjust exception handling
1 parent 9bf9e1b commit 79eab27

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libs/entitlement/qa/entitlement-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/NioFileSystemActions.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import java.io.IOException;
1616
import java.net.URI;
17+
import java.nio.file.FileSystemException;
1718
import java.nio.file.FileSystems;
1819
import java.nio.file.Path;
1920
import java.nio.file.StandardOpenOption;
@@ -107,7 +108,7 @@ static void checkCreateSymbolicLink() throws IOException {
107108
var directory = EntitledActions.createTempDirectoryForWrite();
108109
try {
109110
fs.createSymbolicLink(directory.resolve("link"), FileCheckActions.readFile());
110-
} catch (UnsupportedOperationException e) {
111+
} catch (UnsupportedOperationException | FileSystemException e) {
111112
// OK not to implement symbolic link in the filesystem
112113
}
113114
}
@@ -118,7 +119,7 @@ static void checkCreateLink() throws IOException {
118119
var directory = EntitledActions.createTempDirectoryForWrite();
119120
try {
120121
fs.createLink(directory.resolve("link"), FileCheckActions.readFile());
121-
} catch (UnsupportedOperationException e) {
122+
} catch (UnsupportedOperationException | FileSystemException e) {
122123
// OK not to implement symbolic link in the filesystem
123124
}
124125
}
@@ -214,7 +215,7 @@ static void checkSetAttribute() throws IOException {
214215
var file = EntitledActions.createTempFileForWrite();
215216
try {
216217
fs.setAttribute(file, "dos:hidden", true);
217-
} catch (UnsupportedOperationException | IllegalArgumentException e) {
218+
} catch (UnsupportedOperationException | IllegalArgumentException | FileSystemException e) {
218219
// OK if the file does not have/does not support the attribute
219220
}
220221
}

0 commit comments

Comments
 (0)