| Index: client/third_party/infra_libs/ts_mon/common/errors.py
|
| diff --git a/client/third_party/infra_libs/ts_mon/common/errors.py b/client/third_party/infra_libs/ts_mon/common/errors.py
|
| index 0784a579791600fad4a816389a870d0f9510f947..3bf76315ce16340f840863e648bf96def7834b99 100644
|
| --- a/client/third_party/infra_libs/ts_mon/common/errors.py
|
| +++ b/client/third_party/infra_libs/ts_mon/common/errors.py
|
| @@ -125,3 +125,20 @@ class UnknownModificationTypeError(MonitoringError):
|
|
|
| def __str__(self):
|
| return 'Unknown modification type "%s"' % self.mod_type
|
| +
|
| +
|
| +class MetricDefinitionError(MonitoringError):
|
| + """Raised when a metric was defined incorrectly."""
|
| +
|
| +
|
| +class WrongFieldsError(MonitoringError):
|
| + """Raised when a metric is given different fields to its definition."""
|
| +
|
| + def __init__(self, metric_name, got, expected):
|
| + self.metric_name = metric_name
|
| + self.got = got
|
| + self.expected = expected
|
| +
|
| + def __str__(self):
|
| + return 'Metric "%s" is defined with %s fields but was given %s' % (
|
| + self.metric_name, self.expected, self.got)
|
|
|