diff --git a/lib/storage/tag_filters.go b/lib/storage/tag_filters.go index 88bb7953e..7aa7ba695 100644 --- a/lib/storage/tag_filters.go +++ b/lib/storage/tag_filters.go @@ -94,9 +94,13 @@ func (tfs *TagFilters) cloneWithNegativeFilter(tfNegative *tagFilter) *TagFilter for i := range tfs.tfs { tf := &tfs.tfs[i] if tf == tfNegative { - tfsNew.Add(tf.key, []byte(".+"), true, true) + if err := tfsNew.Add(tf.key, []byte(".+"), true, true); err != nil { + logger.Panicf("BUG: unexpected error when creating a tag filter key=~'.+': %s", err) + } } else { - tfsNew.Add(tf.key, tf.value, tf.isNegative, tf.isRegexp) + if err := tfsNew.Add(tf.key, tf.value, tf.isNegative, tf.isRegexp); err != nil { + logger.Panicf("BUG: unexpected error when cloning a tag filter %s: %s", tf, err) + } } } return tfsNew