Fix CatchingUnchecked Error Prone violations (#5950)

Co-authored-by: James Nord <jtnord@users.noreply.github.com>
This commit is contained in:
Basil CrowandJames Nord authored and GitHub committed 2021-12-10 09:51:30 -08:00
1 parent cce020fdf3
commit 2ea1148286
31 files changed
+43 -53

No files matched your search

+2 -2
View File
@@ -204,7 +204,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
// Secure initialization
CHECK_UPDATE_SLEEP_TIME_MILLIS = SystemProperties.getInteger(PluginManager.class.getName() + ".checkUpdateSleepTimeMillis", 1000);
CHECK_UPDATE_ATTEMPTS = SystemProperties.getInteger(PluginManager.class.getName() + ".checkUpdateAttempts", 1);
} catch(Exception e) {
} catch(RuntimeException e) {
LOGGER.warning(String.format("There was an error initializing the PluginManager. Exception: %s", e));
} finally {
CHECK_UPDATE_ATTEMPTS = CHECK_UPDATE_ATTEMPTS > 0 ? CHECK_UPDATE_ATTEMPTS : 1;
@@ -1584,7 +1584,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
responseData.put("correlationId", correlationId.toString());
return hudson.util.HttpResponses.okJSON(responseData);
} catch (Exception e) {
} catch (RuntimeException e) {
return hudson.util.HttpResponses.errorJSON(e.getMessage());
}
}