1#
2# Copyright (C) 2016 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
17from vts.runners.host import signals
18
19
20class VtsError(Exception):
21    """Raised for general VTS exceptions."""
22
23
24class BaseTestError(VtsError):
25    """Raised for exceptions that occured in BaseTestClass."""
26
27
28class USERError(VtsError):
29    """Raised when a problem is caused by user mistake, e.g. wrong command,
30    misformatted config, test info, wrong test paths etc.
31    """
32
33
34class ComponentLoadingError(VtsError):
35    """Raised if it is unable to load a target component on a target device."""
36
37
38class ConnectionRefusedError(VtsError):
39    """Failure due to wrong port number.
40
41      Raised when an attempt to connect to a TCP server fails due to incorrect
42      port number, such as 21.
43    """
44
45
46class VtsTcpClientCreationError(VtsError):
47    """Raised when TcpClient creation failed."""
48
49
50class VtsTcpCommunicationError(VtsError):
51    """Raised when TcpClient communication failed."""
52
53
54class VtsUnsupportedTypeError(VtsError):
55    """Raised when an unsupported type is used."""
56
57
58class VtsMalformedProtoStringError(VtsError):
59    """Raised when a StringDataValueMessage is not populated or corrupted."""
60
61