Add large try-catch block around SoneInserter’s run() method.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Apr 2011 09:22:40 +0000 (11:22 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 5 Apr 2011 09:22:40 +0000 (11:22 +0200)
src/main/java/net/pterodactylus/sone/core/SoneInserter.java

index 05fa4b4..15e054f 100644 (file)
@@ -160,7 +160,7 @@ public class SoneInserter extends AbstractService {
        protected void serviceRun() {
                long lastModificationTime = 0;
                String lastFingerprint = "";
-               while (!shouldStop()) {
+               while (!shouldStop()) { try {
                        /* check every seconds. */
                        sleep(1000);
 
@@ -236,7 +236,9 @@ public class SoneInserter extends AbstractService {
                                        }
                                }
                        }
-               }
+               } catch (Throwable t1) {
+                       logger.log(Level.SEVERE, "SoneInserter threw an Exception!", t1);
+               }}
        }
 
        /**