Skip to content

Commit f28bad4

Browse files
committed
better handling of FileSystemAlreadyExistsException
1 parent a50b584 commit f28bad4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

operator/src/main/java/oracle/kubernetes/operator/helpers/ConfigMapHelper.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.net.URISyntaxException;
99
import java.nio.charset.StandardCharsets;
1010
import java.nio.file.FileSystem;
11+
import java.nio.file.FileSystemAlreadyExistsException;
1112
import java.nio.file.FileSystems;
1213
import java.nio.file.Files;
1314
import java.nio.file.Path;
@@ -173,15 +174,16 @@ private synchronized Map<String, String> loadScripts() {
173174
} else {
174175
return walkScriptsPath(Paths.get(uri));
175176
}
176-
} catch (IOException e) {
177-
LOGGER.warning(MessageKeys.EXCEPTION, e);
178-
e.printStackTrace(); // xyz-
179-
LOGGER.warning(MessageKeys.EXCEPTION, new IOException("xyz- uri is " + uri));
177+
} catch (FileSystemAlreadyExistsException ale) {
178+
LOGGER.warning(MessageKeys.EXCEPTION, new IOException("xyz-FileSystemAlreadyExistsException uri is " + uri));
180179
try (FileSystem fileSystem = FileSystems.getFileSystem(uri)) {
181180
return walkScriptsPath(fileSystem.getPath(SCRIPTS));
182-
} catch(IOException ioe) {
181+
} catch(IOException e) {
183182
throw new RuntimeException(e);
184183
}
184+
} catch (IOException e) {
185+
LOGGER.warning(MessageKeys.EXCEPTION, e);
186+
throw new RuntimeException(e);
185187
}
186188
}
187189

0 commit comments

Comments
 (0)