ProjectWatch: Also log exception when filter is invalid This allows to understand why the filter is invalid. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I0ccf05b37507ec85325d1eabd81d58675eeb6725
diff --git a/java/com/google/gerrit/server/mail/send/ProjectWatch.java b/java/com/google/gerrit/server/mail/send/ProjectWatch.java index 5ab1acb..06a2e0d 100644 --- a/java/com/google/gerrit/server/mail/send/ProjectWatch.java +++ b/java/com/google/gerrit/server/mail/send/ProjectWatch.java
@@ -99,9 +99,9 @@ try { add(matching, state.getNameKey(), nc); } catch (QueryParseException e) { - logger.atWarning().log( - "Project %s has invalid notify %s filter \"%s\": %s", - state.getName(), nc.getName(), nc.getFilter(), e.getMessage()); + logger.atWarning().withCause(e).log( + "Project %s has invalid notify %s filter \"%s\"", + state.getName(), nc.getName(), nc.getFilter()); } } } @@ -232,7 +232,8 @@ logger.atFine().log("The filter did not match for account %s; skip notification", accountId); } catch (QueryParseException e) { // Ignore broken filter expressions. - logger.atWarning().log("Account %s has invalid filter in project watch %s", accountId, key); + logger.atWarning().withCause(e).log( + "Account %s has invalid filter in project watch %s", accountId, key); } return false; }