Skip to content

Commit

Permalink
Fixed incompatibility with Java 1.3: I was trying to catch an excepti…
Browse files Browse the repository at this point in the history
…on that Java 1.3 doesn't know about, so the class was not even loadable.
  • Loading branch information
Pierre-Luc Paour committed Sep 6, 2003
1 parent eb19834 commit 860fd7a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
2003-09-06 Pierre-Luc Paour <gallery@paour.com> (1.1-RC1-b1)

* Fixed incompatibility with Java 1.3: I was trying to catch an exception
that Java 1.3 doesn't know about, so the class was not even loadable.

2003-08-22 Pierre-Luc Paour <gallery@paour.com> (1.1-RC1)

* Catching error when using SSL with an untrusted server
Expand Down
26 changes: 17 additions & 9 deletions com/gallery/GalleryRemote/GalleryComm.java
Expand Up @@ -191,7 +191,7 @@ public static GalleryComm getCommInstance(StatusUpdate su, URL url, Gallery g) {
return new GalleryComm2(g);
}
} catch (HTTPClient.ProtocolNotSuppException e) {
e.printStackTrace();
Log.logException(Log.ERROR, MODULE, e);
}

return null;
Expand All @@ -215,14 +215,22 @@ private static boolean tryComm(StatusUpdate su, HTTPConnection mConnection, Stri
return rspCode == 200;
} catch (UnknownHostException uhe) {
su.error("Unknown host: " + mConnection.getHost());
} catch (javax.net.ssl.SSLPeerUnverifiedException ssle) {
Log.logException(Log.ERROR, MODULE, ssle);

JOptionPane.showMessageDialog((Component) su, "The site you are trying to connect to is not signed by an authorized provider.\n" +
"Please refer to the following document for help:\n" +
"http://www.infy.com/knowledge_capital/thought-papers/usingHTTPwith_java.pdf", "Error", JOptionPane.ERROR_MESSAGE);
} catch (IOException ioe) {
Log.logException(Log.ERROR, MODULE, ioe);
} catch (IOException ioe) {
// we can't directly catch the SSLPeerUnverifiedException, because Java 1.3 barfs and prevents
// loading this class at all. Instead, cast it inside another try-catch...
try {
if (ioe instanceof javax.net.ssl.SSLPeerUnverifiedException) {
Log.logException(Log.ERROR, MODULE, ioe);

JOptionPane.showMessageDialog((Component) su, "The site you are trying to connect to is not signed by an authorized provider.\n" +
"Please refer to the following document for help:\n" +
"http://www.infy.com/knowledge_capital/thought-papers/usingHTTPwith_java.pdf", "Error", JOptionPane.ERROR_MESSAGE);
} else {
Log.logException(Log.ERROR, MODULE, ioe);
}
} catch (NoClassDefFoundError ncdfe) {
Log.logException(Log.ERROR, MODULE, ioe);
}
} catch (ModuleException me) {
Log.logException(Log.ERROR, MODULE, me);
}
Expand Down
6 changes: 3 additions & 3 deletions defaults.properties
Expand Up @@ -110,12 +110,12 @@ updateCheck=true
updateUrl=http://gallery.sourceforge.net/gallery_remote_version_check.php

# Check for unofficial beta updates on launch
updateCheckBeta=false
updateCheckBeta=true
updateUrlBeta=http://gallery.sourceforge.net/gallery_remote_version_check_beta.php

#
# --- Do not edit below this line ---
#
version=1.1-RC1
releaseDate=2003/08/22
version=1.1-RC1-b1
releaseDate=2003/09/06
aboutText=Gallery Remote\n \n \nA part of the Gallery Open-Source Project\nhttp://gallery.sourceforge.net\n \n \nMaintained by Pierre-Luc Paour\n \nInitial version by Chris Smith\n \n \nContributors:\n \nTim Miller\nDolan Halbrook\n \n \nArtwork by Ross A. Reyman\n \n \nBundled software:\n \nImageMagick\nJSX\nJava look and feel Graphics Repository icons\njpegtran, Guido Vollbeding's version

0 comments on commit 860fd7a

Please sign in to comment.