未验证 提交 6a3e60ef 编写于 作者: J Jesse Glick

[JENKINS-46041] If guessBrowser fails, return null and move on.

上级 0d1f80ba
...@@ -54,6 +54,8 @@ import java.io.IOException; ...@@ -54,6 +54,8 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
...@@ -86,6 +88,8 @@ import org.kohsuke.stapler.export.ExportedBean; ...@@ -86,6 +88,8 @@ import org.kohsuke.stapler.export.ExportedBean;
@ExportedBean @ExportedBean
public abstract class SCM implements Describable<SCM>, ExtensionPoint { public abstract class SCM implements Describable<SCM>, ExtensionPoint {
private static final Logger LOGGER = Logger.getLogger(SCM.class.getName());
/** JENKINS-35098: discouraged */ /** JENKINS-35098: discouraged */
@SuppressWarnings("FieldMayBeFinal") @SuppressWarnings("FieldMayBeFinal")
private static boolean useAutoBrowserHolder = SystemProperties.getBoolean(SCM.class.getName() + ".useAutoBrowserHolder"); private static boolean useAutoBrowserHolder = SystemProperties.getBoolean(SCM.class.getName() + ".useAutoBrowserHolder");
...@@ -143,7 +147,12 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint { ...@@ -143,7 +147,12 @@ public abstract class SCM implements Describable<SCM>, ExtensionPoint {
} }
return autoBrowserHolder.get(); return autoBrowserHolder.get();
} else { } else {
try {
return guessBrowser(); return guessBrowser();
} catch (RuntimeException x) {
LOGGER.log(Level.WARNING, null, x);
return null;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册