From c1a9442546346aeaa8fd1d43535783af0face16c Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Fri, 9 Feb 2018 10:04:34 +0100 Subject: SONAR-10071 Omit stack trace when SCM provider autodetection failed --- .../src/main/java/org/sonar/scanner/scm/ScmConfiguration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sonar-scanner-engine') diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java index 89db46b1fc7..55931063274 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmConfiguration.java @@ -35,6 +35,7 @@ import org.sonar.api.batch.ScannerSide; import org.sonar.api.batch.fs.internal.InputModuleHierarchy; import org.sonar.api.batch.scm.ScmProvider; import org.sonar.api.config.Configuration; +import org.sonar.api.utils.MessageException; import org.sonar.api.utils.log.Logger; import org.sonar.api.utils.log.Loggers; @@ -127,7 +128,7 @@ public class ScmConfiguration implements Startable { if (this.provider == null) { this.provider = installedProvider; } else { - throw new IllegalStateException("SCM provider autodetection failed. Both " + this.provider.key() + " and " + installedProvider.key() + throw MessageException.of("SCM provider autodetection failed. Both " + this.provider.key() + " and " + installedProvider.key() + " claim to support this project. Please use " + CoreProperties.SCM_PROVIDER_KEY + " to define SCM of your project."); } } -- cgit v1.2.3