aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}
}