Rename OrmException to StorageException and move to exceptions package
Subclasses are also renamed: * OrmDuplicateKeyException -> DuplicateKeyException * OrmRuntimeException -> StorageRuntimeException Change-Id: I0e934f177e98667ec7cb9912f246ac649a4efd99
This commit is contained in:
@@ -16,6 +16,7 @@ package com.google.gerrit.server.args4j;
|
||||
|
||||
import static com.google.gerrit.util.cli.Localizable.localizable;
|
||||
|
||||
import com.google.gerrit.exceptions.StorageException;
|
||||
import com.google.gerrit.extensions.client.AuthType;
|
||||
import com.google.gerrit.extensions.restapi.UnprocessableEntityException;
|
||||
import com.google.gerrit.reviewdb.client.Account;
|
||||
@@ -25,7 +26,6 @@ import com.google.gerrit.server.account.AccountResolver;
|
||||
import com.google.gerrit.server.account.AuthRequest;
|
||||
import com.google.gerrit.server.account.externalids.ExternalId;
|
||||
import com.google.gerrit.server.config.AuthConfig;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
import java.io.IOException;
|
||||
@@ -81,7 +81,7 @@ public class AccountIdHandler extends OptionHandler<Account.Id> {
|
||||
throw new CmdLineException(owner, localizable("user \"%s\" not found"), token);
|
||||
}
|
||||
}
|
||||
} catch (OrmException e) {
|
||||
} catch (StorageException e) {
|
||||
throw new CmdLineException(owner, localizable("database is down"));
|
||||
} catch (IOException e) {
|
||||
throw new CmdLineException(owner, "Failed to load account", e);
|
||||
|
||||
@@ -17,12 +17,12 @@ package com.google.gerrit.server.args4j;
|
||||
import static com.google.gerrit.util.cli.Localizable.localizable;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.gerrit.exceptions.StorageException;
|
||||
import com.google.gerrit.reviewdb.client.Branch;
|
||||
import com.google.gerrit.reviewdb.client.Change;
|
||||
import com.google.gerrit.reviewdb.client.Project;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gerrit.server.query.change.InternalChangeQuery;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
@@ -67,7 +67,7 @@ public class ChangeIdHandler extends OptionHandler<Change.Id> {
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new CmdLineException(owner, localizable("Change-Id is not valid"));
|
||||
} catch (OrmException e) {
|
||||
} catch (StorageException e) {
|
||||
throw new CmdLineException(owner, localizable("Database error: %s"), e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user