Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(826)

Side by Side Diff: client/third_party/infra_libs/ts_mon/common/errors.py

Issue 2991803002: Update infra_libs to 1.1.15 / 0b44aba87c1c6538439df6d24a409870810747ab (Closed)
Patch Set: fix Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Classes representing errors that can be raised by the monitoring library.""" 5 """Classes representing errors that can be raised by the monitoring library."""
6 6
7 7
8 class MonitoringError(Exception): 8 class MonitoringError(Exception):
9 """Base class for exceptions raised by this module.""" 9 """Base class for exceptions raised by this module."""
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 """Raised when some error is encountered in flushing specific metrics.""" 110 """Raised when some error is encountered in flushing specific metrics."""
111 111
112 def __init__(self, error_count): 112 def __init__(self, error_count):
113 self.error_count = error_count 113 self.error_count = error_count
114 114
115 def __str__(self): 115 def __str__(self):
116 return ('Failed to flush %d metrics. See tracebacks above' % 116 return ('Failed to flush %d metrics. See tracebacks above' %
117 (self.error_count)) 117 (self.error_count))
118 118
119 119
120 class UnknownModificationTypeError(MonitoringError):
121 """Raised when using a Modification with an unknown type value."""
122
123 def __init__(self, mod_type):
124 self.mod_type = mod_type
125
126 def __str__(self):
127 return 'Unknown modification type "%s"' % self.mod_type
128
129
130 class MetricDefinitionError(MonitoringError): 120 class MetricDefinitionError(MonitoringError):
131 """Raised when a metric was defined incorrectly.""" 121 """Raised when a metric was defined incorrectly."""
132 122
133 123
134 class WrongFieldsError(MonitoringError): 124 class WrongFieldsError(MonitoringError):
135 """Raised when a metric is given different fields to its definition.""" 125 """Raised when a metric is given different fields to its definition."""
136 126
137 def __init__(self, metric_name, got, expected): 127 def __init__(self, metric_name, got, expected):
138 self.metric_name = metric_name 128 self.metric_name = metric_name
139 self.got = got 129 self.got = got
140 self.expected = expected 130 self.expected = expected
141 131
142 def __str__(self): 132 def __str__(self):
143 return 'Metric "%s" is defined with %s fields but was given %s' % ( 133 return 'Metric "%s" is defined with %s fields but was given %s' % (
144 self.metric_name, self.expected, self.got) 134 self.metric_name, self.expected, self.got)
OLDNEW
« no previous file with comments | « client/third_party/infra_libs/ts_mon/common/distribution.py ('k') | client/third_party/infra_libs/ts_mon/common/helpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698