File: Error.py

package info (click to toggle)
aap 1.072-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 4,976 kB
  • ctags: 2,160
  • sloc: python: 15,113; makefile: 62; sh: 13
file content (51 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download | duplicates (2)
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
47
48
49
50
51
# Part of the A-A-P recipe executive: remember the work specified in the recipe

# Copyright (C) 2002-2003 Stichting NLnet Labs
# Permission to copy and use this file is specified in the file COPYING.
# If this file is missing you can find it here: http://www.a-a-p.org/COPYING

#
# Errors
#
# It's OK to do "from Errors import *", these things are supposed to be global.
#

class NormalExit(Exception):
    """Normal exit, used for "--version", ":exit", etc."""
    def __init__(self):
        Exception.__init__(self)

class FinishRecipe(Exception):
    """Quit the current recipe, used ":finish"."""
    def __init__(self):
        Exception.__init__(self)

class UserError(Exception):
    """Error for something the user has done wrong.
       Usually causes us to exit with a non-zero value."""
    def __init__(self, args = None):
        Exception.__init__(self)
        self.args = args

class WriteAfterRead(Exception):
    """Error for writing a local variable after reading it from another scope.
    """
    def __init__(self, args = None):
        Exception.__init__(self)
        self.args = args

class InternalError(Exception):
    """Error for something wrong in our code.
       Usually causes us to exit with a non-zero value."""
    def __init__(self, args = None):
        Exception.__init__(self)
        self.args = args

class OriginUpdate(Exception):
    """An ":recipe" command updated the recipe file and throws this exception
       to cancel executing the old one."""
    def __init__(self, args = None):
        Exception.__init__(self)
        self.args = args

# vim: set sw=4 et sts=4 tw=79 fo+=l: