Skip to content

Commit 7edc652

Browse files
committed
Add logging
1 parent 8480571 commit 7edc652

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

core/src/main/java/net/adoptopenjdk/icedteaweb/client/GuiLaunchHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
import net.adoptopenjdk.icedteaweb.client.parts.splashscreen.JNLPSplashScreen;
3737
import net.adoptopenjdk.icedteaweb.jnlp.element.information.IconKind;
38+
import net.adoptopenjdk.icedteaweb.logging.Logger;
39+
import net.adoptopenjdk.icedteaweb.logging.LoggerFactory;
3840
import net.adoptopenjdk.icedteaweb.resources.ResourceTracker;
3941
import net.adoptopenjdk.icedteaweb.ui.swing.SwingUtils;
4042
import net.sourceforge.jnlp.AbstractLaunchHandler;
@@ -53,6 +55,7 @@
5355
*/
5456
public class GuiLaunchHandler extends AbstractLaunchHandler {
5557

58+
private static final Logger LOG = LoggerFactory.getLogger(GuiLaunchHandler.class);
5659
private volatile JNLPSplashScreen splashScreen = null;
5760
private final Object mutex = new Object();
5861

@@ -67,6 +70,7 @@ public void launchCompleted(ApplicationInstance application) {
6770

6871
@Override
6972
public void handleLaunchError(final LaunchException exception) {
73+
LOG.debug("HandleLaunchError Sbow BasicExceptionDialog {}", exception.getMessage());
7074
BasicExceptionDialog.willBeShown();
7175
SwingUtils.invokeLater(() -> {
7276
closeSplashScreen();

core/src/main/java/net/adoptopenjdk/icedteaweb/resources/ResourceHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ private static void validateWithWhitelist(URL url) {
9393
if (isUrlInWhitelist(url, getApplicationUrlWhiteList())) {
9494
return;
9595
}
96-
BasicExceptionDialog.show(new SecurityException(Translator.R("SWPInvalidURL") + ": " + url));
9796
LOG.error("Resource URL not In Whitelist: {}", url);
97+
BasicExceptionDialog.show(new SecurityException(Translator.R("SWPInvalidURL") + ": " + url));
9898
JNLPRuntime.exit(-1);
9999
}
100100
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Resource download() {
7575
.map(Optional::get)
7676
.findFirst()
7777
.orElseGet(() -> {
78-
LOG.error("could not download resource {} from any of theses urls {} {}", resource, downloadUrls, exceptionMessage());
78+
LOG.error("Could not download resource {} from any of theses urls {} {}", resource, downloadUrls, exceptionMessage());
7979
resource.setStatus(ERROR);
8080
checkForProxyError();
8181
return resource;
@@ -107,6 +107,7 @@ private void checkForProxyError() {
107107
for (final Exception excp : downLoadExceptions) {
108108
final Throwable cause = excp.getCause();
109109
if (cause instanceof IOException && !(cause instanceof FileNotFoundException) && cause.getMessage().toLowerCase().contains("proxy")) {
110+
LOG.debug("checkForProxyError : show Exception Dialog for exception : {} cause : {}", excp.getMessage(), cause.getMessage());
110111
BasicExceptionDialog.willBeShown();
111112
SwingUtils.invokeLater(() -> {
112113
BasicExceptionDialog.show((IOException) cause);
@@ -123,6 +124,7 @@ private CompletableFuture<Resource> downloadFrom(final URL url) {
123124
try {
124125
result.complete(tryDownloading(url));
125126
} catch (Exception | Error e) {
127+
LOG.debug("downloadFrom exception: {}", e.getMessage());
126128
result.completeExceptionally(e);
127129
}
128130
});
@@ -136,6 +138,7 @@ private Resource tryDownloading(final URL downloadFrom) throws IOException {
136138

137139
if (downloadDetails.contentType != null && downloadDetails.contentType.startsWith(ERROR_MIME_TYPE)) {
138140
final String serverResponse = StreamUtils.readStreamAsString(downloadDetails.inputStream);
141+
LOG.debug("Server Error for {}", resource);
139142
throw new RuntimeException("Server error: " + serverResponse);
140143
}
141144

0 commit comments

Comments
 (0)