blob: d4b516ac6a054a59cba9306c411cf78ab02c3cfc (
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
|
##############################################################################
# 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
self.message = "Invalid content in {0}".format(filename)
class NotFoundError(BaseError):
def __init__(self, needle, heystack='qtip'):
self.needle = needle
self.heystack = heystack
self.message = "{0} not found in {1}".format(needle[0:-5], heystack)
class ToBeDoneError(BaseError):
"""something still to be done"""
def __init__(self, method, module):
self.method = method
self.module = module
|