@@ -2174,33 +2174,21 @@ FormValidation checkUpdateSiteURL(@CheckForNull String value) throws Interrupted
21742174
21752175 private FormValidation checkUpdatesServer () throws Exception {
21762176 for (UpdateSite site : Jenkins .get ().getUpdateCenter ().getSites ()) {
2177- try {
2178- FormValidation v = site .updateDirectlyNow ();
2179- if (v .kind != FormValidation .Kind .OK ) {
2180- // Stop with an error
2181- return v ;
2182- }
2183- } catch (IOException e ) {
2184- String url = site .getUrl ();
2185- LOGGER .log (Level .SEVERE , "Failed to check updates server: " + url , e );
2186- return FormValidation .error ("Failed to check updates server: " + e .getMessage ());
2177+ FormValidation v = site .updateDirectlyNow ();
2178+ if (v .kind != FormValidation .Kind .OK ) {
2179+ // Stop with an error
2180+ LOGGER .log (Level .SEVERE , "Failed to check updates server: " + site .getUrl ());
2181+ return v ;
21872182 }
21882183 }
2189-
21902184 for (DownloadService .Downloadable d : DownloadService .Downloadable .all ()) {
2191- try {
2192- FormValidation v = d .updateNow ();
2193- if (v .kind != FormValidation .Kind .OK ) {
2194- // Stop with an error
2195- return v ;
2196- }
2197- } catch (IOException e ) {
2198- String url = d .getUrl ();
2199- LOGGER .log (Level .SEVERE , "Failed to update downloadable: " + url , e );
2200- return FormValidation .error (e , "Failed to update downloadable: " + e .getMessage ());
2185+ FormValidation v = d .updateNow ();
2186+ if (v .kind != FormValidation .Kind .OK ) {
2187+ // Stop with an error
2188+ LOGGER .log (Level .SEVERE , "Failed to update downloadable: " + d .getUrl ());
2189+ return v ;
22012190 }
22022191 }
2203-
22042192 return FormValidation .ok ();
22052193 }
22062194
0 commit comments