Fix error message in MergeOp

Do not include error message from UpdateException.

Change-Id: I54193ae0c7f86d1b87db000c2902663729daeb4c
This commit is contained in:
Zhen Chen
2016-10-12 12:47:27 -07:00
committed by David Pursehouse
parent 0dcdaf17e6
commit ce5a06e891

View File

@@ -470,7 +470,9 @@ public class MergeOp implements AutoCloseable {
BatchUpdate.execute(orm.batchUpdates(allProjects),
new SubmitStrategyListener(submitInput, strategies, commits),
submissionId);
} catch (UpdateException | SubmoduleException e) {
} catch (SubmoduleException e) {
throw new IntegrationException(e);
} catch (UpdateException e) {
// BatchUpdate may have inadvertently wrapped an IntegrationException
// thrown by some legacy SubmitStrategyOp code that intended the error
// message to be user-visible. Copy the message from the wrapped
@@ -482,8 +484,7 @@ public class MergeOp implements AutoCloseable {
if (e.getCause() instanceof IntegrationException) {
msg = e.getCause().getMessage();
} else {
msg = "Error submitting change" + (cs.size() != 1 ? "s" : "") + ": \n"
+ e.getMessage();
msg = "Error submitting change" + (cs.size() != 1 ? "s" : "");
}
throw new IntegrationException(msg, e);
}