From 37d2575f6b11234a37d45695c05e4f95a6faefa2 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 6 Nov 2013 08:15:44 -0500 Subject: [PATCH] [JENKINS-18922] Trying to make this error (missing maven-plugin) nonfatal during startup. May not suffice: a fatal error may simply be thrown later on. --- core/src/main/java/hudson/model/UpdateCenter.java | 2 +- .../java/hudson/model/listeners/SaveableListener.java | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/UpdateCenter.java b/core/src/main/java/hudson/model/UpdateCenter.java index bb5ad2ccf8..ba0bd6efd5 100644 --- a/core/src/main/java/hudson/model/UpdateCenter.java +++ b/core/src/main/java/hudson/model/UpdateCenter.java @@ -1544,7 +1544,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas * * This has to wait until after all plugins load, to let custom UpdateCenterConfiguration take effect first. */ - @Initializer(after=PLUGINS_STARTED) + @Initializer(after=PLUGINS_STARTED, fatal=false) public static void init(Jenkins h) throws IOException { h.getUpdateCenter().load(); } diff --git a/core/src/main/java/hudson/model/listeners/SaveableListener.java b/core/src/main/java/hudson/model/listeners/SaveableListener.java index 0716b053ef..f8380616c5 100644 --- a/core/src/main/java/hudson/model/listeners/SaveableListener.java +++ b/core/src/main/java/hudson/model/listeners/SaveableListener.java @@ -30,6 +30,8 @@ import hudson.ExtensionList; import hudson.XmlFile; import jenkins.model.Jenkins; import hudson.model.Saveable; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Receives notifications about save actions on {@link Saveable} objects in Hudson. @@ -75,7 +77,13 @@ public abstract class SaveableListener implements ExtensionPoint { */ public static void fireOnChange(Saveable o, XmlFile file) { for (SaveableListener l : all()) { - l.onChange(o,file); + try { + l.onChange(o,file); + } catch (ThreadDeath t) { + throw t; + } catch (Throwable t) { + Logger.getLogger(SaveableListener.class.getName()).log(Level.WARNING, null, t); + } } } -- GitLab