Skip to content

Commit 8480571

Browse files
committed
OWS-606: FileNotFound treated as Proxy exception
1 parent 73571a8 commit 8480571

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

core/src/main/java/net/adoptopenjdk/icedteaweb/resources/downloader/BaseResourceDownloader.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
import net.adoptopenjdk.icedteaweb.resources.Resource;
1313
import net.adoptopenjdk.icedteaweb.resources.cache.Cache;
1414
import net.adoptopenjdk.icedteaweb.resources.cache.DownloadInfo;
15+
import net.adoptopenjdk.icedteaweb.ui.swing.SwingUtils;
1516
import net.sourceforge.jnlp.config.ConfigurationConstants;
1617
import net.sourceforge.jnlp.runtime.JNLPRuntime;
1718
import net.sourceforge.jnlp.util.UrlUtils;
1819

1920
import java.io.ByteArrayInputStream;
2021
import java.io.File;
22+
import java.io.FileNotFoundException;
2123
import java.io.IOException;
2224
import java.io.InputStream;
2325
import java.net.Socket;
@@ -104,9 +106,12 @@ private String exceptionMessage(final Exception e) {
104106
private void checkForProxyError() {
105107
for (final Exception excp : downLoadExceptions) {
106108
final Throwable cause = excp.getCause();
107-
if (cause instanceof IOException && cause.getMessage().toLowerCase().contains("proxy")) {
108-
BasicExceptionDialog.show((IOException) cause);
109-
JNLPRuntime.exit(-1);
109+
if (cause instanceof IOException && !(cause instanceof FileNotFoundException) && cause.getMessage().toLowerCase().contains("proxy")) {
110+
BasicExceptionDialog.willBeShown();
111+
SwingUtils.invokeLater(() -> {
112+
BasicExceptionDialog.show((IOException) cause);
113+
JNLPRuntime.exit(-1, false);
114+
});
110115
}
111116
}
112117
}

core/src/main/java/net/sourceforge/jnlp/runtime/JNLPRuntime.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,19 @@ private static boolean isPluginDebug() {
894894
return pluginDebug;
895895
}
896896

897-
public static <T> T exit(int i) {
898-
waitForExceptionDialogsToBeClosed();
897+
public static <T> T exit(int i, boolean waitToCloseExceptionDialogs) {
898+
LOG.debug("JNLPRuntime,exit()");
899+
if (waitToCloseExceptionDialogs) {
900+
waitForExceptionDialogsToBeClosed();
901+
}
899902
System.exit(i);
900903
return null;
901904
}
902905

906+
public static <T> T exit(int i) {
907+
return exit(i, true);
908+
}
909+
903910
public static void waitForExceptionDialogsToBeClosed() {
904911
try {
905912
if (BasicExceptionDialog.areShown()) {

0 commit comments

Comments
 (0)