Просмотр исходного кода

Merge pull request #67 from overleaf/sk-dont-catch-throwable-swap-impl

Don't catch `Throwable` in swap-job, catch Exception
Shane Kilkelly 7 лет назад
Родитель
Сommit
a68afc2e28

+ 2 - 2
services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/swap/job/SwapJobImpl.java

@@ -139,8 +139,8 @@ public class SwapJobImpl implements SwapJob {
             String projectName = dbStore.getOldestUnswappedProject();
             String projectName = dbStore.getOldestUnswappedProject();
             try {
             try {
                 evict(projectName);
                 evict(projectName);
-            } catch (Throwable t) {
-                Log.warn("[{}] Exception while swapping, mark project and move on", projectName, t);
+            } catch (Exception e) {
+                Log.warn("[{}] Exception while swapping, mark project and move on", projectName, e);
                 // NOTE: this is something of a hack. If a project fails to swap we get stuck in a
                 // NOTE: this is something of a hack. If a project fails to swap we get stuck in a
                 // loop where `dbStore.getOldestUnswappedProject()` gives the same failing project over and over again,
                 // loop where `dbStore.getOldestUnswappedProject()` gives the same failing project over and over again,
                 // which fills up the disk with errors. By touching the access time we can mark the project as a
                 // which fills up the disk with errors. By touching the access time we can mark the project as a