Use try/multi-catch
Change-Id: Icf5042cccb0662d6bd53302800e03211af94c16d
This commit is contained in:

committed by
David Pursehouse

parent
8702786e5a
commit
64cfaf242d
@@ -238,11 +238,7 @@ public class CatServlet extends HttpServlet {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
getServletContext().log("Cannot read repository", e);
|
||||
rsp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
} catch (RuntimeException e) {
|
||||
} catch (IOException | RuntimeException e) {
|
||||
getServletContext().log("Cannot read repository", e);
|
||||
rsp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
return;
|
||||
|
@@ -66,13 +66,8 @@ public abstract class Handler<T> implements Callable<T> {
|
||||
if (r != null) {
|
||||
callback.onSuccess(r);
|
||||
}
|
||||
} catch (NoSuchProjectException e) {
|
||||
callback.onFailure(new NoSuchEntityException());
|
||||
|
||||
} catch (NoSuchRefException e) {
|
||||
callback.onFailure(new NoSuchEntityException());
|
||||
|
||||
} catch (NoSuchChangeException e) {
|
||||
} catch (NoSuchProjectException | NoSuchChangeException
|
||||
| NoSuchRefException e) {
|
||||
callback.onFailure(new NoSuchEntityException());
|
||||
|
||||
} catch (OrmException e) {
|
||||
|
@@ -234,11 +234,8 @@ class AccountSecurityImpl extends BaseServiceImplementation implements
|
||||
} else {
|
||||
throw new EmailTokenVerifier.InvalidTokenException();
|
||||
}
|
||||
} catch (EmailTokenVerifier.InvalidTokenException e) {
|
||||
callback.onFailure(e);
|
||||
} catch (AccountException e) {
|
||||
callback.onFailure(e);
|
||||
} catch (OrmException e) {
|
||||
} catch (EmailTokenVerifier.InvalidTokenException | OrmException
|
||||
| AccountException e) {
|
||||
callback.onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@@ -146,9 +146,7 @@ public abstract class ProjectAccessHandler<T> extends Handler<T> {
|
||||
"You are not allowed to change the parent project since you are "
|
||||
+ "not an administrator. You may save the modifications for review "
|
||||
+ "so that an administrator can approve them.", e);
|
||||
} catch (ResourceConflictException e) {
|
||||
throw new UpdateParentFailedException(e.getMessage(), e);
|
||||
} catch (UnprocessableEntityException e) {
|
||||
} catch (ResourceConflictException | UnprocessableEntityException e) {
|
||||
throw new UpdateParentFailedException(e.getMessage(), e);
|
||||
}
|
||||
config.getProject().setParentName(parentProjectName);
|
||||
|
Reference in New Issue
Block a user