Skip to content

Commit

Permalink
[HWKMETRICS-789] do not swallow exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanda committed May 25, 2018
1 parent f834692 commit 36c7764
Showing 1 changed file with 6 additions and 11 deletions.
Expand Up @@ -565,18 +565,13 @@ private Func1<Row, Boolean> tagValueFilter(String regexp, int index) {
private Func1<Metric<?>, Boolean> tagValueFilter(String regexp, String tagName) {
// If no such tagName -> no match
return tMetric -> {
try {
String tagValue = tMetric.getTags().get(tagName);
if(tagValue != null) {
boolean positive = (!regexp.startsWith("!"));
Pattern p = PatternUtil.filterPattern(regexp);
return positive == p.matcher(tagValue).matches(); // XNOR
}
return false;
} catch (Exception e) {
logger.warn("tagValueFilter failed", e);
return false;
String tagValue = tMetric.getTags().get(tagName);
if(tagValue != null) {
boolean positive = (!regexp.startsWith("!"));
Pattern p = PatternUtil.filterPattern(regexp);
return positive == p.matcher(tagValue).matches(); // XNOR
}
return false;
};
}

Expand Down

0 comments on commit 36c7764

Please sign in to comment.