Changeset 51c5da3
- Timestamp:
- Nov 12, 2015 6:49:13 PM (5 years ago)
- Branches:
- master
- Children:
- c609781
- Parents:
- 37a4fcb
- Files:
-
- 78 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
r37a4fcb r51c5da3 2052 2052 ok = monitorTorrents(dir); 2053 2053 } 2054 } catch ( Exception e) {2054 } catch (RuntimeException e) { 2055 2055 _log.error("Error in the DirectoryMonitor", e); 2056 2056 ok = false; … … 2061 2061 addMagnets(); 2062 2062 doMagnets = false; 2063 } catch ( Exception e) {2063 } catch (RuntimeException e) { 2064 2064 _log.error("Error in the DirectoryMonitor", e); 2065 2065 } … … 2267 2267 // don't let one bad torrent kill the whole loop 2268 2268 addTorrent(name, null, !shouldAutoStart()); 2269 } catch ( Exception e) {2269 } catch (RuntimeException e) { 2270 2270 addMessage(_t("Error: Could not add the torrent {0}", name) + ": " + e); 2271 2271 _log.error("Unable to add the torrent " + name, e); … … 2286 2286 // don't let one bad torrent kill the whole loop 2287 2287 stopTorrent(name, true); 2288 } catch ( Exception e) {2288 } catch (RuntimeException e) { 2289 2289 // don't bother with message 2290 2290 } … … 2468 2468 try { 2469 2469 run2(); 2470 } catch ( Exception e) {2470 } catch (RuntimeException e) { 2471 2471 _log.error("Error starting", e); 2472 2472 } … … 2596 2596 addMessageNoEscape(_t("Finished recheck of torrent {0}, unchanged", link)); 2597 2597 } 2598 } catch ( Exception e) {2598 } catch (IOException e) { 2599 2599 _log.error("Error rechecking " + snark.getBaseName(), e); 2600 2600 addMessage(_t("Error checking the torrent {0}", snark.getBaseName()) + ": " + e); -
apps/i2psnark/java/src/org/klomp/snark/Storage.java
r37a4fcb r51c5da3 749 749 rv = repl; 750 750 } 751 } catch ( Exception ex) {751 } catch (RuntimeException ex) { 752 752 ex.printStackTrace(); 753 753 } … … 1484 1484 } // switch 1485 1485 } // while 1486 } catch ( Exception e) {1486 } catch (RuntimeException e) { 1487 1487 e.printStackTrace(); 1488 1488 error = true; -
apps/i2psnark/java/src/org/klomp/snark/dht/NodeInfo.java
r37a4fcb r51c5da3 226 226 // assume dest matches, ignore it 227 227 return this.hash.equals(ni.hash) && nID.equals(ni.nID) && port == ni.port; 228 } catch ( Exception e) {228 } catch (RuntimeException e) { 229 229 return false; 230 230 } -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/GunzipOutputStream.java
r37a4fcb r51c5da3 106 106 try { 107 107 return inf.getBytesRead(); 108 } catch ( Exception e) {108 } catch (RuntimeException e) { 109 109 return 0; 110 110 } … … 117 117 try { 118 118 return inf.getBytesWritten(); 119 } catch ( Exception e) {119 } catch (RuntimeException e) { 120 120 // possible NPE in some implementations 121 121 return 0; … … 129 129 try { 130 130 return inf.getRemaining(); 131 } catch ( Exception e) {131 } catch (RuntimeException e) { 132 132 // possible NPE in some implementations 133 133 return 0; … … 141 141 try { 142 142 return inf.finished(); 143 } catch ( Exception e) {143 } catch (RuntimeException e) { 144 144 // possible NPE in some implementations 145 145 return true; -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java
r37a4fcb r51c5da3 1874 1874 result.fromByteArray(content); 1875 1875 return result; 1876 } catch ( Exception ex) {1876 } catch (RuntimeException ex) { 1877 1877 if (log.shouldLog(Log.INFO)) 1878 1878 log.info("File is not a binary destination - trying base64"); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
r37a4fcb r51c5da3 4 4 package net.i2p.i2ptunnel; 5 5 6 import java.io.IOException; 6 7 import java.net.Socket; 7 8 import java.net.UnknownHostException; … … 11 12 import java.util.StringTokenizer; 12 13 14 import net.i2p.I2PException; 13 15 import net.i2p.client.streaming.I2PSocket; 14 16 import net.i2p.client.streaming.I2PSocketAddress; … … 123 125 //t.start(); 124 126 t.run(); 125 } catch (Exception ex) { 127 } catch (IOException ex) { 128 if (_log.shouldLog(Log.INFO)) 129 _log.info("Error connecting", ex); 130 //l.log("Error connecting: " + ex.getMessage()); 131 closeSocket(s); 132 if (i2ps != null) { 133 synchronized (sockLock) { 134 mySockets.remove(sockLock); 135 } 136 } 137 } catch (I2PException ex) { 126 138 if (_log.shouldLog(Log.INFO)) 127 139 _log.info("Error connecting", ex); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java
r37a4fcb r51c5da3 743 743 try { 744 744 return def.getTotalIn(); 745 } catch ( Exception e) {745 } catch (RuntimeException e) { 746 746 // j2se 1.4.2_08 on linux is sometimes throwing an NPE in the getTotalIn() implementation 747 747 return 0; … … 751 751 try { 752 752 return def.getTotalOut(); 753 } catch ( Exception e) {753 } catch (RuntimeException e) { 754 754 // j2se 1.4.2_08 on linux is sometimes throwing an NPE in the getTotalOut() implementation 755 755 return 0; -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java
r37a4fcb r51c5da3 9 9 import java.util.StringTokenizer; 10 10 11 import net.i2p.I2PException; 11 12 import net.i2p.client.streaming.I2PSocket; 12 13 import net.i2p.client.streaming.I2PSocketAddress; … … 143 144 //out.start(); 144 145 out.run(); 145 } catch ( Exception ex) {146 } catch (IOException ex) { 146 147 // generally NoRouteToHostException 147 148 if (_log.shouldLog(Log.WARN)) … … 161 162 } 162 163 } 164 } catch (I2PException ex) { 165 if (_log.shouldLog(Log.WARN)) 166 _log.warn("Error connecting", ex); 167 //l.log("Error connecting: " + ex.getMessage()); 168 try { 169 // Send a response so the user doesn't just see a disconnect 170 // and blame his router or the network. 171 String name = addr != null ? addr.getHostName() : "undefined"; 172 String msg = ":" + name + " 499 you :" + ex + "\r\n"; 173 s.getOutputStream().write(DataHelper.getUTF8(msg)); 174 } catch (IOException ioe) {} 175 closeSocket(s); 176 if (i2ps != null) { 177 synchronized (sockLock) { 178 mySockets.remove(sockLock); 179 } 180 } 163 181 } 164 182 -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java
r37a4fcb r51c5da3 183 183 if (_log.shouldLog(Log.WARN)) 184 184 _log.warn("gnu?", ise); 185 } catch ( Exception e) {185 } catch (RuntimeException e) { 186 186 if (_log.shouldLog(Log.ERROR)) 187 187 _log.error("Internal error", e); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java
r37a4fcb r51c5da3 327 327 if (_log.shouldLog(Log.WARN)) 328 328 _log.warn("gnu?", ise); 329 } catch ( Exception e) {329 } catch (RuntimeException e) { 330 330 if (_log.shouldLog(Log.ERROR)) 331 331 _log.error("Internal error", e); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java
r37a4fcb r51c5da3 518 518 } catch(SocketTimeoutException ste) { 519 519 // ignored, we never set the timeout 520 } catch ( Exception e) {520 } catch (RuntimeException e) { 521 521 // streaming borkage 522 522 if (_log.shouldLog(Log.ERROR)) -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java
r37a4fcb r51c5da3 231 231 try { 232 232 doStartTunnel(); 233 } catch ( Exception e) {233 } catch (RuntimeException e) { 234 234 _log.error("Error starting the tunnel " + getName(), e); 235 235 log("Error starting the tunnel " + getName() + ": " + e.getMessage()); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCClient.java
r37a4fcb r51c5da3 7 7 import java.io.IOException; 8 8 9 import net.i2p.I2PException; 9 10 import net.i2p.client.streaming.I2PSocket; 10 11 import net.i2p.client.streaming.I2PSocketManager; … … 81 82 //t.start(); 82 83 t.run(); 83 } catch (Exception ex) { 84 } catch (IOException ex) { 85 _log.error("Could not make DCC connection to " + _dest + ':' + _remotePort, ex); 86 closeSocket(s); 87 if (i2ps != null) { 88 try { i2ps.close(); } catch (IOException ioe) {} 89 } 90 notifyEvent(CONNECT_STOP_EVENT, Integer.valueOf(getLocalPort())); 91 } catch (I2PException ex) { 84 92 _log.error("Could not make DCC connection to " + _dest + ':' + _remotePort, ex); 85 93 closeSocket(s); -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java
r37a4fcb r51c5da3 10 10 11 11 import net.i2p.I2PAppContext; 12 import net.i2p.I2PException; 12 13 import net.i2p.client.I2PClient; 13 14 import net.i2p.crypto.SigType; … … 342 343 if (rv != null) 343 344 return rv; 344 } catch (Exception e) {} 345 } catch (I2PException e) { 346 } catch (IOException e) {} 345 347 } 346 348 } -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java
r37a4fcb r51c5da3 9 9 */ 10 10 11 import java.io.IOException; 11 12 import java.util.List; 12 13 import java.util.Set; 14 15 import net.i2p.I2PException; 13 16 import net.i2p.crypto.SigType; 14 17 import net.i2p.data.Base64; … … 88 91 Signature sig = _context.dsa().sign(spoof.getBytes("UTF-8"), privKey); 89 92 return Base64.encode(sig.getData()); 90 } catch (Exception e) {} 93 } catch (I2PException e) { 94 } catch (IOException e) {} 91 95 } 92 96 return ""; -
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java
r37a4fcb r51c5da3 10 10 11 11 import java.io.File; 12 import java.io.IOException; 12 13 import java.util.ArrayList; 13 14 import java.util.List; … … 16 17 17 18 import net.i2p.I2PAppContext; 19 import net.i2p.I2PException; 18 20 import net.i2p.app.ClientAppManager; 19 21 import net.i2p.app.Outproxy; … … 267 269 try { 268 270 buf.append(processAction()).append('\n'); 269 } catch ( Exception e) {271 } catch (RuntimeException e) { 270 272 _log.log(Log.CRIT, "Error processing " + _action, e); 271 273 buf.append("Error: ").append(e.toString()).append('\n'); … … 973 975 try { 974 976 pkf.createIfAbsent(); 975 } catch (Exception e) { 977 } catch (I2PException e) { 978 return "Create private key file failed: " + e; 979 } catch (IOException e) { 976 980 return "Create private key file failed: " + e; 977 981 } … … 1012 1016 pkf.write(); 1013 1017 newdest = pkf.getDestination(); 1014 } catch (Exception e) { 1018 } catch (I2PException e) { 1019 return "Modification failed: " + e; 1020 } catch (IOException e) { 1015 1021 return "Modification failed: " + e; 1016 1022 } -
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java
r37a4fcb r51c5da3 275 275 } 276 276 } 277 } catch ( Exception e) {277 } catch (RuntimeException e) { 278 278 e.printStackTrace(); 279 279 usage(); -
apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
r37a4fcb r51c5da3 196 196 try { 197 197 client.createDestination(keyStream, getSigType(opts)); 198 } catch (Exception e) { 198 } catch (I2PException e) { 199 throw new I2PSessionException("Error creating keys", e); 200 } catch (IOException e) { 199 201 throw new I2PSessionException("Error creating keys", e); 200 202 } -
apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java
r37a4fcb r51c5da3 108 108 r = "" + MIN_REFRESH; 109 109 _context.router().saveConfig(PROP_REFRESH, r); 110 } catch ( Exception e) {110 } catch (RuntimeException e) { 111 111 } 112 112 } … … 118 118 if (Integer.parseInt(r) < MIN_REFRESH) 119 119 r = "" + MIN_REFRESH; 120 } catch ( Exception e) {120 } catch (RuntimeException e) { 121 121 r = "" + MIN_REFRESH; 122 122 } -
apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java
r37a4fcb r51c5da3 424 424 log.error("INFO: Adding translation plugin to classpath: " + f); 425 425 added = true; 426 } catch ( Exception e) {426 } catch (RuntimeException e) { 427 427 log.error("Plugin " + appName + " bad classpath element: " + f, e); 428 428 } … … 962 962 if (log.shouldLog(Log.WARN)) 963 963 log.warn("INFO: Adding plugin to classpath: " + f); 964 } catch ( Exception e) {964 } catch (IOException e) { 965 965 log.error("Plugin client " + clientName + " bad classpath element: " + f, e); 966 966 } -
apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java
r37a4fcb r51c5da3 10 10 import java.net.Socket; 11 11 import java.net.SocketTimeoutException; 12 import java.security.GeneralSecurityException; 12 13 import java.util.HashSet; 13 14 import java.util.List; … … 260 261 priv.writeBytes(keyStream); 261 262 keys[1].writeBytes(keyStream); // signing priv 262 } catch (Exception e) { 263 } catch (GeneralSecurityException e) { 264 throw new I2PSessionException("Error creating keys", e); 265 } catch (I2PException e) { 266 throw new I2PSessionException("Error creating keys", e); 267 } catch (IOException e) { 268 throw new I2PSessionException("Error creating keys", e); 269 } catch (RuntimeException e) { 263 270 throw new I2PSessionException("Error creating keys", e); 264 271 } -
apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java
r37a4fcb r51c5da3 165 165 message = generateLoadMessage(); 166 166 } 167 catch ( Exception e) {167 catch (IOException e) { 168 168 warn(e); 169 169 } finally { … … 317 317 save(); 318 318 message += "<br>" + _t("Address book saved."); 319 } catch ( Exception e) {319 } catch (IOException e) { 320 320 warn(e); 321 321 message += "<br>" + _t("ERROR: Could not write addressbook file."); -
apps/susidns/src/java/src/i2p/susi/dns/NamingServiceBean.java
r37a4fcb r51c5da3 206 206 message = generateLoadMessage(); 207 207 } 208 catch ( Exception e) {208 catch (RuntimeException e) { 209 209 warn(e); 210 210 } -
apps/susimail/src/src/i2p/susi/util/Config.java
r37a4fcb r51c5da3 99 99 iv = Config.class.getResourceAsStream("/susimail.properties"); 100 100 properties.load(iv); 101 } catch ( Exception e) {101 } catch (IOException e) { 102 102 Debug.debug(Debug.ERROR, "Could not open WEB-INF/classes/susimail.properties (possibly in jar), reason: " + e); 103 103 } finally { … … 110 110 DataHelper.loadProps(config, cfg); 111 111 } 112 } catch ( Exception e) {112 } catch (IOException e) { 113 113 Debug.debug(Debug.ERROR, "Could not open susimail.config, reason: " + e); 114 114 } -
apps/susimail/src/src/i2p/susi/webmail/Mail.java
r37a4fcb r51c5da3 128 128 } catch (DecodingException de) { 129 129 Debug.debug(Debug.ERROR, "Decode error: " + de); 130 } catch ( Exception e) {130 } catch (RuntimeException e) { 131 131 Debug.debug(Debug.ERROR, "Parse error: " + e); 132 132 } -
apps/susimail/src/src/i2p/susi/webmail/WebMail.java
r37a4fcb r51c5da3 615 615 reason = _t("Charset \\''{0}\\'' not supported.", quoteHTML( mailPart.charset )) + br; 616 616 } 617 catch ( Exception e1) {617 catch (IOException e1) { 618 618 showBody = false; 619 619 reason += _t("Part ({0}) not shown, because of {1}", ident, e1.toString()) + br; -
apps/susimail/src/src/i2p/susi/webmail/encoding/DecodingException.java
r37a4fcb r51c5da3 24 24 package i2p.susi.webmail.encoding; 25 25 26 import java.io.IOException; 27 26 28 /** 27 29 * @author susi 28 30 */ 29 public class DecodingException extends Exception {31 public class DecodingException extends IOException { 30 32 private static final long serialVersionUID = 1L; 31 33 -
apps/susimail/src/src/i2p/susi/webmail/encoding/HeaderLine.java
r37a4fcb r51c5da3 234 234 lastCharWasQuoted = true; 235 235 continue; 236 } catch (Exception e1) { 236 } catch (IOException e1) { 237 Debug.debug(Debug.ERROR, e1.toString()); 238 } catch (RuntimeException e1) { 237 239 Debug.debug(Debug.ERROR, e1.toString()); 238 240 } -
apps/susimail/src/src/i2p/susi/webmail/smtp/SMTPClient.java
r37a4fcb r51c5da3 211 211 try { 212 212 socket = new Socket( host, port ); 213 } catch ( Exception e) {213 } catch (IOException e) { 214 214 error += _t("Cannot connect") + ": " + e.getMessage() + '\n'; 215 215 ok = false; -
apps/systray/java/src/net/i2p/apps/systray/ConfigFile.java
r37a4fcb r51c5da3 63 63 fileInputStream = new FileInputStream(_configFile); 64 64 _properties.load(fileInputStream); 65 } catch ( Exception e) {65 } catch (IOException e) { 66 66 rv = false; 67 67 } finally { … … 80 80 fileOutputStream = new FileOutputStream(_configFile); 81 81 _properties.store(fileOutputStream, null); 82 } catch ( Exception e) {82 } catch (IOException e) { 83 83 rv = false; 84 84 } finally { -
apps/systray/java/src/net/i2p/apps/systray/SysTray.java
r37a4fcb r51c5da3 89 89 if (urlLauncher.openUrl(url)) 90 90 return; 91 } catch ( Exception ex) {91 } catch (RuntimeException ex) { 92 92 // Fall through. 93 93 } … … 96 96 if (urlLauncher.openUrl(url, _browserString)) 97 97 return; 98 } catch ( Exception ex) {98 } catch (RuntimeException ex) { 99 99 // Fall through. 100 100 } -
apps/systray/java/src/net/i2p/apps/systray/UrlLauncher.java
r37a4fcb r51c5da3 150 150 } catch (InterruptedException ie) {} 151 151 return true; 152 } catch ( Exception e) {}152 } catch (IOException e) {} 153 153 if (System.currentTimeMillis() > done) 154 154 break; … … 172 172 * <code>false</code>. 173 173 * 174 * @throws Exception174 * @throws IOException 175 175 */ 176 public boolean openUrl(String url) throws Exception {176 public boolean openUrl(String url) throws IOException { 177 177 waitForServer(url); 178 178 if (validateUrlFormat(url)) { … … 218 218 } 219 219 foo.delete(); 220 } catch ( Exception e) {220 } catch (IOException e) { 221 221 // Defaults to IE. 222 222 } finally { … … 247 247 * otherwise <code>false</code>. 248 248 * 249 * @throws Exception250 */ 251 public boolean openUrl(String url, String browser) throws Exception {249 * @throws IOException 250 */ 251 public boolean openUrl(String url, String browser) throws IOException { 252 252 waitForServer(url); 253 253 if (validateUrlFormat(url)) { … … 290 290 openUrl(url); 291 291 changeState(STOPPED); 292 } catch ( Exception e) {292 } catch (IOException e) { 293 293 changeState(CRASHED, e); 294 294 } … … 355 355 else 356 356 launcher.openUrl("http://127.0.0.1:7657/index.jsp"); 357 } catch ( Exception e) {}357 } catch (IOException e) {} 358 358 } 359 359 } -
core/java/src/net/i2p/client/impl/I2PSessionImpl.java
r37a4fcb r51c5da3 863 863 _log.info("Message availability notification for " + msgId.intValue() + " took " 864 864 + duration + " to " + _sessionListener); 865 } catch ( Exception e) {865 } catch (RuntimeException e) { 866 866 _log.log(Log.CRIT, "Error notifying app of message availability", e); 867 867 } -
core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java
r37a4fcb r51c5da3 400 400 _demultiplexer.messageAvailable(I2PSessionMuxedImpl.this, 401 401 msg.id, msg.size, msg.proto, msg.fromPort, msg.toPort); 402 } catch ( Exception e) {402 } catch (RuntimeException e) { 403 403 _log.error("Error notifying app of message availability", e); 404 404 } -
core/java/src/net/i2p/client/naming/SingleFileNamingService.java
r37a4fcb r51c5da3 92 92 if (key != null) 93 93 return lookupBase64(key); 94 } catch ( Exception ioe) {94 } catch (IOException ioe) { 95 95 if (_file.exists()) 96 96 _log.error("Error loading hosts file " + _file, ioe); … … 124 124 } 125 125 return null; 126 } catch ( Exception ioe) {126 } catch (IOException ioe) { 127 127 if (_file.exists()) 128 128 _log.error("Error loading hosts file " + _file, ioe); -
core/java/src/net/i2p/crypto/DSAEngine.java
r37a4fcb r51c5da3 258 258 } 259 259 return ok; 260 } catch ( Exception e) {260 } catch (RuntimeException e) { 261 261 _log.log(Log.CRIT, "Error verifying the signature", e); 262 262 return false; -
core/java/src/net/i2p/crypto/ECConstants.java
r37a4fcb r51c5da3 4 4 import java.math.BigInteger; 5 5 import java.security.AlgorithmParameters; 6 import java.security.GeneralSecurityException; 6 7 import java.security.Provider; 7 8 import java.security.Security; … … 279 280 try { 280 281 ap = AlgorithmParameters.getInstance("EC"); 281 } catch ( Exception e) {282 } catch (GeneralSecurityException e) { 282 283 if (BC_AVAILABLE) { 283 284 log("Named curve " + name + " is not available, trying BC", e); … … 293 294 log("Named curve " + name + " loaded"); 294 295 return rv; 295 } catch ( Exception e) {296 } catch (GeneralSecurityException e) { 296 297 log("Named curve " + name + " is not available", e); 297 298 return null; -
core/java/src/net/i2p/crypto/ElGamalAESEngine.java
r37a4fcb r51c5da3 328 328 int cur = 0; 329 329 long numTags = DataHelper.fromLong(decrypted, cur, 2); 330 if ((numTags < 0) || (numTags > MAX_TAGS_RECEIVED)) throw new Exception("Invalid number of session tags");330 if ((numTags < 0) || (numTags > MAX_TAGS_RECEIVED)) throw new IllegalArgumentException("Invalid number of session tags"); 331 331 if (numTags > 0) tags = new ArrayList<SessionTag>((int)numTags); 332 332 cur += 2; 333 333 //_log.debug("# tags: " + numTags); 334 334 if (numTags * SessionTag.BYTE_LENGTH > decrypted.length - 2) { 335 throw new Exception("# tags: " + numTags + " is too many for " + (decrypted.length - 2));335 throw new IllegalArgumentException("# tags: " + numTags + " is too many for " + (decrypted.length - 2)); 336 336 } 337 337 for (int i = 0; i < numTags; i++) { … … 345 345 //_log.debug("len: " + len); 346 346 if ((len < 0) || (len > decrypted.length - cur - Hash.HASH_LENGTH - 1)) 347 throw new Exception("Invalid size of payload (" + len + ", remaining " + (decrypted.length-cur) +")");347 throw new IllegalArgumentException("Invalid size of payload (" + len + ", remaining " + (decrypted.length-cur) +")"); 348 348 //byte hashval[] = new byte[Hash.HASH_LENGTH]; 349 349 //System.arraycopy(decrypted, cur, hashval, 0, Hash.HASH_LENGTH); … … 380 380 } 381 381 382 throw new Exception("Hash does not match");383 } catch ( Exception e) {382 throw new RuntimeException("Hash does not match"); 383 } catch (RuntimeException e) { 384 384 if (_log.shouldLog(Log.WARN)) _log.warn("Unable to decrypt AES block", e); 385 385 return null; -
core/java/src/net/i2p/crypto/EncType.java
r37a4fcb r51c5da3 109 109 try { 110 110 getParams(); 111 } catch ( Exception e) {111 } catch (InvalidParameterSpecException e) { 112 112 return false; 113 113 } -
core/java/src/net/i2p/crypto/KeyGenerator.java
r37a4fcb r51c5da3 344 344 try { 345 345 main2(args); 346 } catch ( Exception e) {346 } catch (RuntimeException e) { 347 347 e.printStackTrace(); 348 348 } … … 382 382 System.out.println("Testing " + type); 383 383 testSig(type, runs); 384 } catch ( Exception e) {384 } catch (GeneralSecurityException e) { 385 385 System.out.println("error testing " + type); 386 386 e.printStackTrace(); -
core/java/src/net/i2p/crypto/KeyStoreUtil.java
r37a4fcb r51c5da3 99 99 ks.load(null, DEFAULT_KEYSTORE_PASSWORD.toCharArray()); 100 100 success = addCerts(new File(System.getProperty("java.home"), "etc/security/cacerts"), ks) > 0; 101 } catch (Exception e) {} 101 } catch (IOException e) { 102 } catch (GeneralSecurityException e) {} 102 103 } else { 103 104 success = loadCerts(new File(System.getProperty("java.home"), "etc/security/cacerts.bks"), ks); … … 114 115 // must be initted 115 116 ks.load(null, DEFAULT_KEYSTORE_PASSWORD.toCharArray()); 116 } catch (Exception e) {} 117 } catch (IOException e) { 118 } catch (GeneralSecurityException e) {} 117 119 error("All key store loads failed, will only load local certificates", null); 118 120 } … … 141 143 // not clear if null is allowed for password 142 144 ks.load(null, DEFAULT_KEYSTORE_PASSWORD.toCharArray()); 143 } catch (Exception foo) {} 145 } catch (IOException foo) { 146 } catch (GeneralSecurityException e) {} 144 147 return false; 145 148 } catch (IOException ioe) { … … 147 150 try { 148 151 ks.load(null, DEFAULT_KEYSTORE_PASSWORD.toCharArray()); 149 } catch (Exception foo) {} 152 } catch (IOException foo) { 153 } catch (GeneralSecurityException e) {} 150 154 return false; 151 155 } finally { … … 172 176 } 173 177 } 174 } catch ( Exception foo) {}178 } catch (GeneralSecurityException e) {} 175 179 return count; 176 180 } … … 317 321 return false; 318 322 } 319 } catch (Exception e) { 323 } catch (IOException e) { 324 error("Not overwriting key \"" + alias + "\", already exists in " + ks, e); 325 return false; 326 } catch (GeneralSecurityException e) { 320 327 error("Not overwriting key \"" + alias + "\", already exists in " + ks, e); 321 328 return false; … … 355 362 if (!success) 356 363 error("Key gen failed to get private key", null); 357 } catch (Exception e) { 364 } catch (IOException e) { 365 error("Key gen failed to get private key", e); 366 success = false; 367 } catch (GeneralSecurityException e) { 358 368 error("Key gen failed to get private key", e); 359 369 success = false; -
core/java/src/net/i2p/crypto/SigType.java
r37a4fcb r51c5da3 1 1 package net.i2p.crypto; 2 2 3 import java.security.GeneralSecurityException; 3 4 import java.security.MessageDigest; 4 5 import java.security.NoSuchAlgorithmException; … … 216 217 getDigestInstance(); 217 218 getHashInstance(); 218 } catch (Exception e) { 219 } catch (GeneralSecurityException e) { 220 return false; 221 } catch (RuntimeException e) { 219 222 return false; 220 223 } -
core/java/src/net/i2p/crypto/TrustedUpdate.java
r37a4fcb r51c5da3 345 345 System.out.println("Public key written to: " + publicKeyFile); 346 346 System.out.println("\r\nPublic key: " + signingPublicKey.toBase64() + "\r\n"); 347 } catch (Exception e) { 347 } catch (IOException e) { 348 System.err.println("Error writing keys:"); 349 e.printStackTrace(); 350 return false; 351 } catch (DataFormatException e) { 348 352 System.err.println("Error writing keys:"); 349 353 e.printStackTrace(); … … 759 763 signature = _context.dsa().sign(bytesToSignInputStream, signingPrivateKey); 760 764 761 } catch ( Exception e) {765 } catch (IOException e) { 762 766 if (_log.shouldLog(Log.ERROR)) 763 767 _log.error("Error signing", e); -
core/java/src/net/i2p/crypto/eddsa/math/GroupElement.java
r37a4fcb r51c5da3 723 723 try { 724 724 ge = ge.toRep(this.repr); 725 } catch ( Exception e) {725 } catch (RuntimeException e) { 726 726 return false; 727 727 } -
core/java/src/net/i2p/data/PrivateKeyFile.java
r37a4fcb r51c5da3 10 10 import java.io.OutputStream; 11 11 import java.security.GeneralSecurityException; 12 import java.security.NoSuchAlgorithmException; 12 13 import java.util.Locale; 13 14 import java.util.Map; … … 175 176 verifySignature(pkf.getDestination()); 176 177 } 177 } catch (Exception e) { 178 } catch (I2PException e) { 179 e.printStackTrace(); 180 System.exit(1); 181 } catch (IOException e) { 178 182 e.printStackTrace(); 179 183 System.exit(1); … … 359 363 try { 360 364 hc = HashCash.mintCash(resource, effort); 361 } catch ( Exception e) {365 } catch (NoSuchAlgorithmException e) { 362 366 return null; 363 367 } … … 392 396 try { 393 397 d2 = pkf2.getDestination(); 394 } catch (Exception e) { 398 } catch (I2PException e) { 399 return null; 400 } catch (IOException e) { 395 401 return null; 396 402 } … … 501 507 try { 502 508 low = HashCash.estimateTime(hashEffort); 503 } catch ( Exception e) {}509 } catch (NoSuchAlgorithmException e) {} 504 510 // takes a lot longer than the estimate usually... 505 511 // maybe because the resource string is much longer than used in the estimate? -
core/java/src/net/i2p/data/i2cp/I2CPMessageReader.java
r37a4fcb r51c5da3 161 161 try { 162 162 run2(); 163 } catch ( Exception e) {163 } catch (RuntimeException e) { 164 164 _log.log(Log.CRIT, "Uncaught I2CP error", e); 165 165 _listener.readError(I2CPMessageReader.this, e); … … 194 194 // ooms seen here... maybe log and keep going? 195 195 throw oom; 196 } catch ( Exception e) {196 } catch (RuntimeException e) { 197 197 _log.log(Log.CRIT, "Unhandled error reading I2CP stream", e); 198 198 _listener.disconnected(I2CPMessageReader.this); -
core/java/src/net/i2p/stat/BufferedStatLog.java
r37a4fcb r51c5da3 146 146 _log.debug("writing " + writeStart +"->"+ writeEnd); 147 147 writeEvents(writeStart, writeEnd); 148 } catch ( Exception e) {148 } catch (RuntimeException e) { 149 149 _log.error("error writing " + writeStart +"->"+ writeEnd, e); 150 150 } -
core/java/src/net/i2p/util/EepGet.java
r37a4fcb r51c5da3 274 274 } // switch 275 275 } // while 276 } catch ( Exception e) {276 } catch (RuntimeException e) { 277 277 e.printStackTrace(); 278 278 error = true; -
core/java/src/net/i2p/util/EepHead.java
r37a4fcb r51c5da3 110 110 } // switch 111 111 } // while 112 } catch ( Exception e) {112 } catch (RuntimeException e) { 113 113 e.printStackTrace(); 114 114 error = true; -
core/java/src/net/i2p/util/FortunaRandomSource.java
r37a4fcb r51c5da3 12 12 import gnu.crypto.prng.AsyncFortunaStandalone; 13 13 14 import java.io.IOException; 14 15 import java.security.SecureRandom; 15 16 … … 267 268 _fortuna.addRandomBytes(data, offset, len); 268 269 } 269 } catch ( Exception e) {270 } catch (RuntimeException e) { 270 271 // AIOOBE seen, root cause unknown, ticket #1576 271 272 Log log = _context.logManager().getLog(FortunaRandomSource.class); … … 291 292 System.out.write(buf); 292 293 } 293 } catch ( Exception e) { e.printStackTrace(); }294 } catch (IOException e) { e.printStackTrace(); } 294 295 } 295 296 } -
core/java/src/net/i2p/util/LogWriterBase.java
r37a4fcb r51c5da3 76 76 rereadConfig(); 77 77 } 78 } catch ( Exception e) {78 } catch (RuntimeException e) { 79 79 System.err.println("Error writing the log: " + e); 80 80 e.printStackTrace(); -
core/java/src/net/i2p/util/PartialEepGet.java
r37a4fcb r51c5da3 108 108 } // switch 109 109 } // while 110 } catch ( Exception e) {110 } catch (RuntimeException e) { 111 111 e.printStackTrace(); 112 112 error = true; -
core/java/src/net/i2p/util/ResettableGZIPInputStream.java
r37a4fcb r51c5da3 125 125 try { 126 126 return inf.getBytesRead(); 127 } catch ( Exception e) {127 } catch (RuntimeException e) { 128 128 return 0; 129 129 } … … 137 137 try { 138 138 return inf.getBytesWritten(); 139 } catch ( Exception e) {139 } catch (RuntimeException e) { 140 140 // possible NPE in some implementations 141 141 return 0; … … 150 150 try { 151 151 return inf.getRemaining(); 152 } catch ( Exception e) {152 } catch (RuntimeException e) { 153 153 // possible NPE in some implementations 154 154 return 0; … … 163 163 try { 164 164 return inf.finished(); 165 } catch ( Exception e) {165 } catch (RuntimeException e) { 166 166 // possible NPE in some implementations 167 167 return true; -
core/java/src/net/i2p/util/SSLEepGet.java
r37a4fcb r51c5da3 181 181 } // switch 182 182 } // while 183 } catch ( Exception e) {183 } catch (RuntimeException e) { 184 184 e.printStackTrace(); 185 185 error = true; … … 371 371 try { 372 372 cert.checkValidity(); 373 } catch ( Exception e) {373 } catch (GeneralSecurityException e) { 374 374 System.out.println(" WARNING: Certificate is not currently valid, it cannot be used"); 375 375 } -
core/java/src/net/i2p/util/ShellCommand.java
r37a4fcb r51c5da3 440 440 try { 441 441 process.waitFor(); 442 } catch ( Exception e) {442 } catch (InterruptedException e) { 443 443 if (DEBUG) { 444 444 System.out.println("ShellCommand exception waiting for \"" + name + '\"'); … … 458 458 return false; 459 459 } 460 } catch ( Exception e) {460 } catch (IOException e) { 461 461 // probably IOException, file not found from exec() 462 462 if (DEBUG) { -
core/java/src/net/metanotion/io/block/BlockFile.java
r37a4fcb r51c5da3 148 148 bf.close(); 149 149 raif.close(); 150 } catch ( Exception e) {150 } catch (IOException e) { 151 151 e.printStackTrace(); 152 152 } -
installer/java/src/net/i2p/installer/Exec.java
r37a4fcb r51c5da3 22 22 Runtime.getRuntime().halt(0); 23 23 24 } catch ( Exception e) {24 } catch (RuntimeException e) { 25 25 e.printStackTrace(); 26 26 } -
installer/tools/java/src/net/i2p/router/networkdb/kademlia/BundleRouterInfos.java
r37a4fcb r51c5da3 110 110 ri.readBytes(fis, true); // true = verify sig on read 111 111 me = ri.getIdentity().getHash(); 112 } catch ( Exception e) {112 } catch (RuntimeException e) { 113 113 //System.out.println("Can't determine our identity"); 114 114 } finally { … … 210 210 else 211 211 System.out.println("Failed copy of " + file + " to " + toDir); 212 } catch ( Exception e) {212 } catch (RuntimeException e) { 213 213 System.out.println("Skipping bad " + file); 214 214 } finally { -
router/java/src/net/i2p/data/i2np/GarlicClove.java
r37a4fcb r51c5da3 159 159 throw new RuntimeException("foo, returned 0 length"); 160 160 out.write(m); 161 } catch ( Exception e) {161 } catch (RuntimeException e) { 162 162 throw new DataFormatException("Unable to write the clove: " + _msg + " to " + out, e); 163 163 } … … 188 188 System.arraycopy(m, 0, rv, offset, m.length); 189 189 offset += m.length; 190 } catch ( Exception e) { throw new RuntimeException("Unable to write: " + _msg + ": " + e.getMessage()); }190 } catch (RuntimeException e) { throw new RuntimeException("Unable to write: " + _msg + ": " + e.getMessage()); } 191 191 DataHelper.toLong(rv, offset, 4, _cloveId); 192 192 offset += 4; -
router/java/src/net/i2p/data/i2np/I2NPMessageHandler.java
r37a4fcb r51c5da3 60 60 } catch (I2NPMessageException ime) { 61 61 throw ime; 62 } catch ( Exception e) {62 } catch (RuntimeException e) { 63 63 if (_log.shouldLog(Log.WARN)) 64 64 _log.warn("Error reading the stream", e); … … 132 132 } catch (I2NPMessageException ime) { 133 133 throw ime; 134 } catch ( Exception e) {134 } catch (RuntimeException e) { 135 135 if (_log.shouldLog(Log.WARN)) 136 136 _log.warn("Error reading the stream", e); -
router/java/src/net/i2p/data/i2np/I2NPMessageReader.java
r37a4fcb r51c5da3 164 164 _listener.disconnected(I2NPMessageReader.this); 165 165 cancelRunner(); 166 } catch ( Exception e) {166 } catch (RuntimeException e) { 167 167 _log.log(Log.CRIT, "error reading msg!", e); 168 168 _listener.readError(I2NPMessageReader.this, e); -
router/java/src/net/i2p/data/router/RouterInfo.java
r37a4fcb r51c5da3 725 725 fail = true; 726 726 } 727 } catch (Exception e) { 727 } catch (IOException e) { 728 System.err.println("Error reading " + args[i] + ": " + e); 729 fail = true; 730 } catch (DataFormatException e) { 728 731 System.err.println("Error reading " + args[i] + ": " + e); 729 732 fail = true; -
router/java/src/net/i2p/router/InNetMessagePool.java
r37a4fcb r51c5da3 435 435 } catch (OutOfMemoryError oome) { 436 436 throw oome; 437 } catch ( Exception e) {437 } catch (RuntimeException e) { 438 438 if (_log.shouldLog(Log.CRIT)) 439 439 _log.log(Log.CRIT, "Error in the tunnel gateway dispatcher", e); … … 468 468 } catch (OutOfMemoryError oome) { 469 469 throw oome; 470 } catch ( Exception e) {470 } catch (RuntimeException e) { 471 471 if (_log.shouldLog(Log.CRIT)) 472 472 _log.log(Log.CRIT, "Error in the tunnel data dispatcher", e); -
router/java/src/net/i2p/router/Router.java
r37a4fcb r51c5da3 10 10 11 11 import java.io.File; 12 import java.io.IOException; 12 13 import java.util.Collection; 13 14 import java.util.Collections; … … 649 650 // System.err.println("WARNING: Configuration file " + filename + " does not exist"); 650 651 } 651 } catch ( Exception ioe) {652 } catch (IOException ioe) { 652 653 if (log != null) 653 654 log.error("Error loading the router configuration from " + filename, ioe); … … 1352 1353 DataHelper.storeProps(ordered, new File(_configFilename)); 1353 1354 } 1354 } catch ( Exception ioe) {1355 } catch (IOException ioe) { 1355 1356 // warning, _log will be null when called from constructor 1356 1357 if (_log != null) -
router/java/src/net/i2p/router/dummy/VMCommSystem.java
r37a4fcb r51c5da3 9 9 import net.i2p.data.Hash; 10 10 import net.i2p.data.i2np.I2NPMessage; 11 import net.i2p.data.i2np.I2NPMessageException; 11 12 import net.i2p.data.i2np.I2NPMessageHandler; 12 13 import net.i2p.router.CommSystemFacade; … … 122 123 123 124 _ctx.inNetMessagePool().add(msg, null, _from); 124 } catch ( Exception e) {125 } catch (I2NPMessageException e) { 125 126 _log.error("Error reading/formatting a VM message? Something is not right...", e); 126 127 } -
router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java
r37a4fcb r51c5da3 544 544 _log.info("Unable to read the router reference in " + _routerFile.getName(), ioe); 545 545 corrupt = true; 546 } catch ( Exception e) {546 } catch (RuntimeException e) { 547 547 // key certificate problems, etc., don't let one bad RI kill the whole thing 548 548 if (_log.shouldLog(Log.INFO)) … … 667 667 Hash h = Hash.create(b); 668 668 return h; 669 } catch ( Exception e) {669 } catch (RuntimeException e) { 670 670 // static 671 671 //_log.warn("Unable to fetch the key from [" + filename + "]", e); -
router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java
r37a4fcb r51c5da3 627 627 System.out.println(); 628 628 } 629 } catch ( Exception e) {629 } catch (RuntimeException e) { 630 630 if (_log.shouldLog(Log.INFO)) 631 631 _log.info("Failed fetch", e); -
router/java/src/net/i2p/router/peermanager/ProfilePersistenceHelper.java
r37a4fcb r51c5da3 302 302 303 303 return profile; 304 } catch ( Exception e) {304 } catch (IOException e) { 305 305 if (_log.shouldLog(Log.WARN)) 306 306 _log.warn("Error loading properties from " + file.getAbsolutePath(), e); … … 370 370 Hash h = Hash.create(b); 371 371 return h; 372 } catch ( Exception dfe) {372 } catch (RuntimeException dfe) { 373 373 _log.warn("Invalid base64 [" + key + "]", dfe); 374 374 return null; -
router/java/src/net/i2p/router/startup/RebuildRouterInfoJob.java
r37a4fcb r51c5da3 99 99 info = new RouterInfo(); 100 100 info.setIdentity(kd.routerIdentity); 101 } catch (Exception e) { 101 } catch (DataFormatException e) { 102 _log.log(Log.CRIT, "Error reading in the key data from " + keyFile.getAbsolutePath(), e); 103 keyFile.delete(); 104 keyFile2.delete(); 105 rebuildRouterInfo(alreadyRunning); 106 return; 107 } catch (IOException e) { 102 108 _log.log(Log.CRIT, "Error reading in the key data from " + keyFile.getAbsolutePath(), e); 103 109 keyFile.delete(); -
router/java/src/net/i2p/router/transport/UPnP.java
r37a4fcb r51c5da3 477 477 try { 478 478 table = serv.getServiceStateTable(); 479 } catch ( Exception e) {479 } catch (RuntimeException e) { 480 480 // getSCPDNode() returns null, 481 481 // NPE at org.cybergarage.upnp.Service.getServiceStateTable(Service.java:526) -
router/java/src/net/i2p/router/transport/UPnPManager.java
r37a4fcb r51c5da3 89 89 if (_log.shouldLog(Log.INFO)) 90 90 _log.info("UPnP runPlugin took " + (_context.clock().now() - b)); 91 } catch ( Exception e) {91 } catch (RuntimeException e) { 92 92 // NPE in UPnP (ticket #728), can't let it bring us down 93 93 if (!_errorLogged) { -
router/java/src/net/i2p/router/transport/ntcp/EventPumper.java
r37a4fcb r51c5da3 336 336 key.cancel(); 337 337 } 338 } catch ( Exception ke) {338 } catch (IOException ke) { 339 339 _log.error("Error closing key " + key + " on pumper shutdown", ke); 340 340 } … … 345 345 _log.debug("Closing down the event pumper with no selection keys remaining"); 346 346 } 347 } catch ( Exception e) {347 } catch (IOException e) { 348 348 _log.error("Error closing keys on pumper shutdown", e); 349 349 } -
router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java
r37a4fcb r51c5da3 464 464 if (_consecutiveBacklog > 10) { // waaay too backlogged 465 465 boolean wantsWrite = false; 466 try { wantsWrite = ( (_conKey.interestOps() & SelectionKey.OP_WRITE) != 0); } catch ( Exception e) {}466 try { wantsWrite = ( (_conKey.interestOps() & SelectionKey.OP_WRITE) != 0); } catch (RuntimeException e) {} 467 467 if (_log.shouldLog(Log.WARN)) { 468 468 int blocks = _writeBufs.size(); … … 522 522 + ", currentOut set? " + currentOutboundSet 523 523 + ", writeBufs: " + writeBufs + " on " + toString()); 524 } catch ( Exception e) {} // java.nio.channels.CancelledKeyException524 } catch (RuntimeException e) {} // java.nio.channels.CancelledKeyException 525 525 } 526 526 //_context.statManager().addRateData("ntcp.sendBacklogTime", queueTime); -
router/java/src/net/i2p/router/transport/udp/ACKSender.java
r37a4fcb r51c5da3 149 149 // bulk operations may throw an exception 150 150 _peersToACK.addAll(notYet); 151 } catch ( Exception e) {}151 } catch (RuntimeException e) {} 152 152 if (_log.shouldLog(Log.DEBUG)) 153 153 _log.debug("sleeping, pending size = " + notYet.size()); -
router/java/src/net/i2p/router/transport/udp/MessageReceiver.java
r37a4fcb r51c5da3 244 244 _context.messageHistory().droppedInboundMessage(state.getMessageId(), state.getFrom(), "error: " + ime.toString() + ": " + state.toString()); 245 245 return null; 246 } catch ( Exception e) {246 } catch (RuntimeException e) { 247 247 // e.g. AIOOBE 248 248 if (_log.shouldLog(Log.WARN)) -
router/java/src/net/i2p/router/transport/udp/PacketHandler.java
r37a4fcb r51c5da3 216 216 handlePacket(_reader, packet); 217 217 _state = 6; 218 } catch ( Exception e) {218 } catch (RuntimeException e) { 219 219 _state = 7; 220 220 if (_log.shouldLog(Log.ERROR)) -
router/java/src/net/i2p/router/transport/udp/PacketPusher.java
r37a4fcb r51c5da3 44 44 } 45 45 } 46 } catch ( Exception e) {46 } catch (RuntimeException e) { 47 47 _log.error("SSU Output Queue Error", e); 48 48 } -
router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java
r37a4fcb r51c5da3 214 214 try { 215 215 handleInboundRequest(); 216 } catch ( Exception e) {216 } catch (RuntimeException e) { 217 217 _log.log(Log.CRIT, "B0rked in the tunnel handler", e); 218 218 }
Note: See TracChangeset
for help on using the changeset viewer.