Catch all exceptions when emailing change update
Similar to b429744e51 catch all
exceptions when sending emails on change update fails and log the
error.
Without this change if an exception occurs, on restore/abandon a
change from the WebUI the change screen is not updated with the new
change status and the popup dialog is not closed.
Change-Id: If1aa1a3d88b8fa997e709e6e360ac4019810a31d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -63,6 +63,8 @@ import org.eclipse.jgit.revwalk.RevCommit;
|
||||
import org.eclipse.jgit.revwalk.RevWalk;
|
||||
import org.eclipse.jgit.util.Base64;
|
||||
import org.eclipse.jgit.util.NB;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -74,6 +76,9 @@ import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
public class ChangeUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ChangeUtil.class);
|
||||
|
||||
private static int uuidPrefix;
|
||||
private static int uuidSeq;
|
||||
|
||||
@@ -592,10 +597,14 @@ public class ChangeUtil {
|
||||
new ApprovalsUtil(db, null).syncChangeStatus(change);
|
||||
|
||||
// Email the reviewers
|
||||
final ReplyToChangeSender cm = senderFactory.create(change);
|
||||
cm.setFrom(user.getAccountId());
|
||||
cm.setChangeMessage(cmsg);
|
||||
cm.send();
|
||||
try {
|
||||
final ReplyToChangeSender cm = senderFactory.create(change);
|
||||
cm.setFrom(user.getAccountId());
|
||||
cm.setChangeMessage(cmsg);
|
||||
cm.send();
|
||||
} catch (Exception e) {
|
||||
log.error("Cannot email update for change " + change.getChangeId(), e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String sortKey(long lastUpdated, int id){
|
||||
|
||||
Reference in New Issue
Block a user