~linaro-validation/lava-core/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright (C) 2011-2012 Linaro Limited
#
# Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
#
# This file is part of lava-core
#
# lava-core is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation
#
# lava-core is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with lava-core.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import

"""
lava.core.errors
================

Common error classes with fuzzy meaning
"""


class PluginLookupError(LookupError):
    """
    Error raised when a plugin cannot be found
    """


class PluginLoadError(ImportError):
    """
    Error raised when a plugin cannot be loaded
    """


class CommandError(Exception):
    """
    Raise this from a Command's invoke() method to display an error nicely.

    `lava` will exit with a status of 1 if this is raised.
    """