• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# !/usr/bin/python
2# Copyright 2017 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16"""Exceptions for At-Factory-Tool Manager (atftman)."""
17
18
19class DeviceNotFoundException(Exception):
20
21  def __init__(self):
22    Exception.__init__(self)
23    self.msg = 'Device Not Found!'
24
25  def SetMsg(self, msg):
26    self.msg = msg
27
28  def __str__(self):
29    return self.msg
30
31
32class NoAlgorithmAvailableException(Exception):
33  pass
34
35
36class FastbootFailure(Exception):
37
38  def __init__(self, msg):
39    Exception.__init__(self)
40    self.msg = msg
41
42  def __str__(self):
43    return self.msg
44
45
46class ProductNotSpecifiedException(Exception):
47
48  def __str__(self):
49    return 'Product Attribute File Not Selected!'
50
51
52class ProductAttributesFileFormatError(Exception):
53
54  def __init__(self, msg):
55    Exception.__init__(self)
56    self.msg = msg
57
58  def __str__(self):
59    return self.msg
60