Merge changes I1aae574a,If44075be
* changes:
Remove unused UpdateParentFailedException
SiteProgram: Remove DB-specific error handling
diff --git a/java/com/google/gerrit/common/errors/UpdateParentFailedException.java b/java/com/google/gerrit/common/errors/UpdateParentFailedException.java
deleted file mode 100644
index 16d5240..0000000
--- a/java/com/google/gerrit/common/errors/UpdateParentFailedException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2013 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.gerrit.common.errors;
-
-/** Error indicating that updating a parent project failed. */
-public class UpdateParentFailedException extends Exception {
- private static final long serialVersionUID = 1L;
-
- public static final String MESSAGE = "Update Parent Project Failed: ";
-
- public UpdateParentFailedException(String message, Throwable why) {
- super(MESSAGE + ": " + message, why);
- }
-}
diff --git a/java/com/google/gerrit/pgm/util/BUILD b/java/com/google/gerrit/pgm/util/BUILD
index 7fe3bfa..defc4d3 100644
--- a/java/com/google/gerrit/pgm/util/BUILD
+++ b/java/com/google/gerrit/pgm/util/BUILD
@@ -20,7 +20,6 @@
"//lib:args4j",
"//lib:guava",
"//lib:gwtorm",
- "//lib/commons:dbcp",
"//lib/flogger:api",
"//lib/guice",
"//lib/jgit/org.eclipse.jgit:jgit",
diff --git a/java/com/google/gerrit/pgm/util/SiteProgram.java b/java/com/google/gerrit/pgm/util/SiteProgram.java
index 8a9ebdb..de8238d 100644
--- a/java/com/google/gerrit/pgm/util/SiteProgram.java
+++ b/java/com/google/gerrit/pgm/util/SiteProgram.java
@@ -27,7 +27,6 @@
import com.google.gerrit.server.git.GitRepositoryManagerModule;
import com.google.gerrit.server.schema.SchemaModule;
import com.google.gerrit.server.securestore.SecureStoreClassName;
-import com.google.gwtorm.server.OrmException;
import com.google.inject.AbstractModule;
import com.google.inject.CreationException;
import com.google.inject.Guice;
@@ -38,14 +37,11 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.kohsuke.args4j.Option;
public abstract class SiteProgram extends AbstractProgram {
- private static final String CONNECTION_ERROR = "Cannot connect to SQL database";
-
@Option(
name = "--site-path",
aliases = {"-d"},
@@ -127,19 +123,6 @@
Message first = ce.getErrorMessages().iterator().next();
Throwable why = first.getCause();
- if (why instanceof SQLException) {
- throw die(CONNECTION_ERROR, why);
- }
- if (why instanceof OrmException
- && why.getCause() != null
- && "Unable to determine driver URL".equals(why.getMessage())) {
- why = why.getCause();
- if (isCannotCreatePoolException(why)) {
- throw die(CONNECTION_ERROR, why.getCause());
- }
- throw die(CONNECTION_ERROR, why);
- }
-
StringBuilder buf = new StringBuilder();
if (why != null) {
buf.append(why.getMessage());
@@ -164,11 +147,4 @@
protected final String getConfiguredSecureStoreClass() {
return getSecureStoreClassName(sitePath);
}
-
- @SuppressWarnings("deprecation")
- private static boolean isCannotCreatePoolException(Throwable why) {
- return why instanceof org.apache.commons.dbcp.SQLNestedException
- && why.getCause() != null
- && why.getMessage().startsWith("Cannot create PoolableConnectionFactory");
- }
}