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

Unified Diff: tools/telemetry/catapult_base/dependency_manager/exceptions.py

Issue 1620023002: Revert of Remove catapult_base from telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perf_cb_move
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/catapult_base/dependency_manager/exceptions.py
diff --git a/tools/telemetry/catapult_base/dependency_manager/exceptions.py b/tools/telemetry/catapult_base/dependency_manager/exceptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..015074f39a1b324322da4dae5d6bfbf73560bf39
--- /dev/null
+++ b/tools/telemetry/catapult_base/dependency_manager/exceptions.py
@@ -0,0 +1,48 @@
+# Copyright 2015 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.
+
+from catapult_base import cloud_storage
+
+class UnsupportedConfigFormatError(ValueError):
+ def __init__(self, config_type, config_file):
+ if not config_type:
+ message = ('The json file at %s is unsupported by the dependency_manager '
+ 'due to no specified config type' % config_file)
+ else:
+ message = ('The json file at %s has config type %s, which is unsupported '
+ 'by the dependency manager.' % (config_file, config_type))
+ super(UnsupportedConfigFormatError, self).__init__(message)
+
+
+class EmptyConfigError(ValueError):
+ def __init__(self, file_path):
+ super(EmptyConfigError, self).__init__('Empty config at %s.' % file_path)
+
+
+class FileNotFoundError(Exception):
+ def __init__(self, file_path):
+ super(FileNotFoundError, self).__init__('No file found at %s' % file_path)
+
+
+class NoPathFoundError(Exception):
+ def __init__(self, dependency, platform):
+ super(NoPathFoundError, self).__init__(
+ 'No file could be found locally, and no file to download from cloud '
+ 'storage for %s on platform %s' % (dependency, platform))
+
+
+class ReadWriteError(Exception):
+ pass
+
+
+class CloudStorageUploadConflictError(cloud_storage.CloudStorageError):
+ def __init__(self, bucket, path):
+ super(CloudStorageUploadConflictError, self).__init__(
+ 'File location %s already exists in bucket %s' % (path, bucket))
+
+
+class ArchiveError(Exception):
+ def __init__(self, msg):
+ super(ArchiveError, self).__init__(msg)
+

Powered by Google App Engine
This is Rietveld 408576698