Chromium Code Reviews| Index: tools/telemetry/telemetry/value/none_values.py |
| diff --git a/tools/telemetry/telemetry/value/none_values.py b/tools/telemetry/telemetry/value/none_values.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a0d635428b12df0d1601cc93f91de55d4422d397 |
| --- /dev/null |
| +++ b/tools/telemetry/telemetry/value/none_values.py |
| @@ -0,0 +1,17 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +MERGE_FAILURE_REASON = "Unable to merge values with None value." |
|
chrishenry
2014/08/15 04:43:20
The merge is successful tho, so maybe "Merging val
ariblue
2014/08/15 22:10:26
Done.
|
| + |
| +class NoneValueMissingReason(Exception): |
| + pass |
| + |
| +class ValueMustHaveNoneValue(Exception): |
| + pass |
| + |
| +def ValidateValue(value, none_value_reason): |
|
nednguyen
2014/08/15 15:50:04
Maybe ValidateNoneAbleValue.
ariblue
2014/08/15 22:10:26
How about ValidateNullableValue?
|
| + if value is None and none_value_reason is None: |
| + raise NoneValueMissingReason() |
| + if value is not None and none_value_reason is not None: |
| + raise ValueMustHaveNoneValue() |
|
chrishenry
2014/08/15 04:43:20
Should this just be part of __init__.py? Thoughts?
nednguyen
2014/08/15 15:50:04
I find the situation of partly "adding the new fie
chrishenry
2014/08/15 16:32:40
Some raw thoughts from my end on this. I don't thi
ariblue
2014/08/15 22:10:26
Acknowledged.
|