summaryrefslogtreecommitdiffstats
path: root/qtip/base/error.py
blob: 01a7f7a60501679bba5309183f2cef56d0bf7918 (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
32
33
34
35
36
##############################################################################
# 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 QtipError(Exception):
    pass


class InvalidFormat(QtipError):
    def __init__(self, filename):
        self.filename = filename


class NotFound(QtipError):
    def __init__(self, module, package='qtip'):
        self.package = package
        self.module = module


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


def make_tbd(method, module='qtip'):
    def tbd():
        raise ToBeDoneError(method, module)
    return tbd