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:
Dave Borowitz
2019-01-15 18:45:22 -08:00
parent 9dd73c8a71
commit 62f32fcfd6
500 changed files with 1973 additions and 1941 deletions

View File

@@ -19,13 +19,13 @@ import static com.google.gerrit.reviewdb.client.PatchLineComment.Status.PUBLISHE
import static java.util.stream.Collectors.toSet;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.exceptions.StorageException;
import com.google.gerrit.reviewdb.client.Comment;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.server.notedb.ChangeNotes;
import com.google.gerrit.server.patch.PatchListCache;
import com.google.gerrit.server.patch.PatchListNotAvailableException;
import com.google.gerrit.server.update.ChangeContext;
import com.google.gwtorm.server.OrmException;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Collection;
@@ -47,7 +47,7 @@ public class PublishCommentUtil {
public void publish(
ChangeContext ctx, PatchSet.Id psId, Collection<Comment> drafts, @Nullable String tag)
throws OrmException {
throws StorageException {
ChangeNotes notes = ctx.getNotes();
checkArgument(notes != null);
if (drafts.isEmpty()) {
@@ -59,7 +59,7 @@ public class PublishCommentUtil {
for (Comment d : drafts) {
PatchSet ps = patchSets.get(psId(notes, d));
if (ps == null) {
throw new OrmException("patch set " + ps + " not found");
throw new StorageException("patch set " + ps + " not found");
}
d.writtenOn = ctx.getWhen();
d.tag = tag;
@@ -69,7 +69,7 @@ public class PublishCommentUtil {
try {
CommentsUtil.setCommentRevId(d, patchListCache, notes.getChange(), ps);
} catch (PatchListNotAvailableException e) {
throw new OrmException(e);
throw new StorageException(e);
}
}
commentsUtil.putComments(ctx.getUpdate(psId), PUBLISHED, drafts);