summaryrefslogtreecommitdiffstats
path: root/qtip/base/error.py
blob: f23d8cd988a911038f1766ec97aae1d4e68e3c11 (plain)
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
##############################################################################
# Copyright (c) 2016 ZTE Corp and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################


class BaseError(Exception):
    pass


class InvalidContentError(BaseError):
    def __init__(self, filename, excinfo=None):
        self.filename = filename
        self.excinfo = excinfo


class NotFoundError(BaseError):
    def __init__(self, needle, heystack='qtip'):
        self.needle = needle
        self.heystack = heystack


class ToBeDoneError(BaseError):
    """something still to be done"""
    def __init__(self, method, module):
        self.method = method
        self.module = module