Don't double wrap ServiceMayNotContinueExceptions
ServiceMayNotContinueException is an IOException, and should just be re-raised in situations that need to throw a ServiceMayNotContinueException. Also, do not set the message on ServiceMayNotContinueException, since it may be returned to the client. Change-Id: I382be1ccb2b1dca50328951239ff27c20f79d0d1
This commit is contained in:
@@ -404,9 +404,10 @@ public class ReceiveCommits {
|
||||
if (allRefs == null) {
|
||||
try {
|
||||
allRefs = rp.getRepository().getRefDatabase().getRefs(ALL);
|
||||
} catch (ServiceMayNotContinueException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
ServiceMayNotContinueException ex =
|
||||
new ServiceMayNotContinueException(e.getMessage());
|
||||
ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
|
||||
ex.initCause(e);
|
||||
throw ex;
|
||||
}
|
||||
|
@@ -68,9 +68,10 @@ public class ReceiveCommitsAdvertiseRefsHook implements AdvertiseRefsHook {
|
||||
if (oldRefs == null) {
|
||||
try {
|
||||
oldRefs = rp.getRepository().getRefDatabase().getRefs(ALL);
|
||||
} catch (ServiceMayNotContinueException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
ServiceMayNotContinueException ex =
|
||||
new ServiceMayNotContinueException(e.getMessage());
|
||||
ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
|
||||
ex.initCause(e);
|
||||
throw ex;
|
||||
}
|
||||
|
@@ -127,9 +127,10 @@ public class VisibleRefFilter extends AbstractAdvertiseRefsHook {
|
||||
RevWalk revWalk) throws ServiceMayNotContinueException {
|
||||
try {
|
||||
return filter(repository.getRefDatabase().getRefs(RefDatabase.ALL));
|
||||
} catch (ServiceMayNotContinueException e) {
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
ServiceMayNotContinueException ex =
|
||||
new ServiceMayNotContinueException(e.getMessage());
|
||||
ServiceMayNotContinueException ex = new ServiceMayNotContinueException();
|
||||
ex.initCause(e);
|
||||
throw ex;
|
||||
}
|
||||
|
Reference in New Issue
Block a user