Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / telemetry / catapult_base / dependency_manager / exceptions.py
blob4d303aa5e7d6a5f66fe45cf1f96a6109181d5f86
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
3 # found in the LICENSE file.
5 class UnsupportedConfigFormatError(ValueError):
6 def __init__(self, config_type, config_file):
7 if not config_type:
8 message = ('The json file at %s is unsupported by the dependency_manager '
9 'due to no specified config type' % config_file)
10 else:
11 message = ('The json file at %s has config type %s, which is unsupported '
12 'by the dependency manager.' % (config_file, config_type))
13 super(UnsupportedConfigFormatError, self).__init__(message)
15 class EmptyConfigError(ValueError):
16 def __init__(self, file_path):
17 super(EmptyConfigError, self).__init__('Empty config at %s.' % file_path)
20 class FileNotFoundError(Exception):
21 def __init__(self, file_path):
22 super(FileNotFoundError, self).__init__('No file found at %s' % file_path)
25 class NoPathFoundError(Exception):
26 def __init__(self, dependency, platform):
27 super(NoPathFoundError, self).__init__(
28 'No file could be found locally, and no file to download from cloud '
29 'storage for %s on platform %s' % (dependency, platform))
31 class ReadWriteError(Exception):
32 pass