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:
@@ -7,13 +7,13 @@ java_library(
|
||||
deps = [
|
||||
"//java/com/google/gerrit/common:annotations",
|
||||
"//java/com/google/gerrit/common:server",
|
||||
"//java/com/google/gerrit/exceptions",
|
||||
"//java/com/google/gerrit/extensions:api",
|
||||
"//java/com/google/gerrit/lifecycle",
|
||||
"//java/com/google/gerrit/reviewdb:server",
|
||||
"//java/com/google/gerrit/server",
|
||||
"//java/com/google/gerrit/server/restapi",
|
||||
"//java/com/google/gerrit/util/cli",
|
||||
"//java/com/google/gwtorm",
|
||||
"//lib:args4j",
|
||||
"//lib:guava",
|
||||
"//lib:servlet-api-3_1",
|
||||
|
||||
@@ -19,6 +19,7 @@ import static com.google.gerrit.server.api.ApiUtil.asRestApiException;
|
||||
import com.google.common.collect.ImmutableListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import com.google.gerrit.common.Nullable;
|
||||
import com.google.gerrit.exceptions.StorageException;
|
||||
import com.google.gerrit.extensions.api.changes.AbandonInput;
|
||||
import com.google.gerrit.extensions.api.changes.AddReviewerInput;
|
||||
import com.google.gerrit.extensions.api.changes.AddReviewerResult;
|
||||
@@ -103,7 +104,6 @@ import com.google.gerrit.server.restapi.change.SubmittedTogether;
|
||||
import com.google.gerrit.server.restapi.change.SuggestChangeReviewers;
|
||||
import com.google.gerrit.server.restapi.change.Unignore;
|
||||
import com.google.gerrit.util.cli.CmdLineParser;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Provider;
|
||||
@@ -613,7 +613,7 @@ class ChangeApiImpl implements ChangeApi {
|
||||
} else {
|
||||
unignore.apply(change, new Input());
|
||||
}
|
||||
} catch (OrmException | IllegalLabelException e) {
|
||||
} catch (StorageException | IllegalLabelException e) {
|
||||
throw asRestApiException("Cannot ignore change", e);
|
||||
}
|
||||
}
|
||||
@@ -622,7 +622,7 @@ class ChangeApiImpl implements ChangeApi {
|
||||
public boolean ignored() throws RestApiException {
|
||||
try {
|
||||
return stars.isIgnored(change);
|
||||
} catch (OrmException e) {
|
||||
} catch (StorageException e) {
|
||||
throw asRestApiException("Cannot check if ignored", e);
|
||||
}
|
||||
}
|
||||
@@ -637,7 +637,7 @@ class ChangeApiImpl implements ChangeApi {
|
||||
} else {
|
||||
markAsUnreviewed.apply(change, new Input());
|
||||
}
|
||||
} catch (OrmException | IllegalLabelException e) {
|
||||
} catch (StorageException | IllegalLabelException e) {
|
||||
throw asRestApiException(
|
||||
"Cannot mark change as " + (reviewed ? "reviewed" : "unreviewed"), e);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.google.gerrit.server.api.changes;
|
||||
|
||||
import static com.google.gerrit.server.api.ApiUtil.asRestApiException;
|
||||
|
||||
import com.google.gerrit.exceptions.StorageException;
|
||||
import com.google.gerrit.extensions.api.changes.ChangeEditApi;
|
||||
import com.google.gerrit.extensions.api.changes.PublishChangeEditInput;
|
||||
import com.google.gerrit.extensions.client.ChangeEditDetailOption;
|
||||
@@ -34,7 +35,6 @@ import com.google.gerrit.server.restapi.change.ChangeEdits;
|
||||
import com.google.gerrit.server.restapi.change.DeleteChangeEdit;
|
||||
import com.google.gerrit.server.restapi.change.PublishChangeEdit;
|
||||
import com.google.gerrit.server.restapi.change.RebaseChangeEdit;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.assistedinject.Assisted;
|
||||
@@ -242,7 +242,7 @@ public class ChangeEditApiImpl implements ChangeEditApi {
|
||||
}
|
||||
|
||||
private ChangeEditResource getChangeEditResource(String filePath)
|
||||
throws ResourceNotFoundException, AuthException, IOException, OrmException {
|
||||
throws ResourceNotFoundException, AuthException, IOException, StorageException {
|
||||
return changeEdits.parse(changeResource, IdString.fromDecoded(filePath));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.google.gerrit.server.api.projects;
|
||||
|
||||
import static com.google.gerrit.server.api.ApiUtil.asRestApiException;
|
||||
|
||||
import com.google.gerrit.exceptions.StorageException;
|
||||
import com.google.gerrit.extensions.api.projects.ProjectApi;
|
||||
import com.google.gerrit.extensions.api.projects.ProjectInput;
|
||||
import com.google.gerrit.extensions.api.projects.Projects;
|
||||
@@ -28,7 +29,6 @@ import com.google.gerrit.server.restapi.project.ListProjects;
|
||||
import com.google.gerrit.server.restapi.project.ListProjects.FilterType;
|
||||
import com.google.gerrit.server.restapi.project.ProjectsCollection;
|
||||
import com.google.gerrit.server.restapi.project.QueryProjects;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.Singleton;
|
||||
@@ -155,7 +155,7 @@ class ProjectsImpl implements Projects {
|
||||
.withLimit(r.getLimit())
|
||||
.withStart(r.getStart())
|
||||
.apply();
|
||||
} catch (OrmException e) {
|
||||
} catch (StorageException e) {
|
||||
throw new RestApiException("Cannot query projects", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user