aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-06-18 17:08:30 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-06-18 17:18:21 +0200
commitd53af792fde9bd9eae47141a1b8abe17d70fe09d (patch)
treeb9dcb1faa41861d35cbaff0d47e2eaf802ad3d23 /sonar-server
parent935d147c998f5b9b1163bcbfea4b0e6fe8341beb (diff)
downloadsonarqube-d53af792fde9bd9eae47141a1b8abe17d70fe09d.tar.gz
sonarqube-d53af792fde9bd9eae47141a1b8abe17d70fe09d.zip
Replace MessageException by IllegalStateException
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/db/migrations/MassUpdater.java7
-rw-r--r--sonar-server/src/test/java/org/sonar/server/db/migrations/MassUpdaterTest.java5
2 files changed, 4 insertions, 8 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/db/migrations/MassUpdater.java b/sonar-server/src/main/java/org/sonar/server/db/migrations/MassUpdater.java
index 494c5e7a4fa..49230376878 100644
--- a/sonar-server/src/main/java/org/sonar/server/db/migrations/MassUpdater.java
+++ b/sonar-server/src/main/java/org/sonar/server/db/migrations/MassUpdater.java
@@ -24,7 +24,6 @@ import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.dbutils.DbUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonar.api.utils.MessageException;
import org.sonar.core.persistence.Database;
import org.sonar.core.persistence.dialect.MySql;
@@ -153,10 +152,8 @@ public class MassUpdater {
writeConnection.commit();
}
- private static MessageException processError(Exception e) {
- String message = String.format("Fail to migrate data, error is : %s", e.getMessage());
- LOGGER.error(message, e);
- throw MessageException.of(message);
+ private static RuntimeException processError(Exception e) {
+ throw new IllegalStateException(e);
}
@VisibleForTesting
diff --git a/sonar-server/src/test/java/org/sonar/server/db/migrations/MassUpdaterTest.java b/sonar-server/src/test/java/org/sonar/server/db/migrations/MassUpdaterTest.java
index 36a9085cf32..92842490101 100644
--- a/sonar-server/src/test/java/org/sonar/server/db/migrations/MassUpdaterTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/db/migrations/MassUpdaterTest.java
@@ -24,7 +24,6 @@ import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import org.sonar.api.utils.MessageException;
import org.sonar.core.persistence.Database;
import org.sonar.core.persistence.TestDatabase;
import org.sonar.core.persistence.dialect.Dialect;
@@ -115,7 +114,7 @@ public class MassUpdaterTest {
);
fail();
} catch (Exception e) {
- assertThat(e).isInstanceOf(MessageException.class);
+ assertThat(e).isInstanceOf(IllegalStateException.class);
}
}
@@ -152,7 +151,7 @@ public class MassUpdaterTest {
);
fail();
} catch (Exception e) {
- assertThat(e).isInstanceOf(MessageException.class);
+ assertThat(e).isInstanceOf(IllegalStateException.class);
}
}