Skip to content

Commit 7c327ae

Browse files
committed
Raise a defined exception
InvalidLabelName is undefined, just raise a ValueError with a consistent message.
1 parent 2404cd5 commit 7c327ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prometheus_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __init__(self, wrappedClass, labelnames, **kwargs):
102102

103103
for l in labelnames:
104104
if l.startswith('__'):
105-
raise InvalidLabelName(l)
105+
raise ValueError('Invalid label metric name: ' + l)
106106

107107
def labels(self, *labelvalues):
108108
'''Return the child for the given labelset.'''

0 commit comments

Comments
 (0)