blob: f9d5c8de5a89b60ddd9b5164ad6b8937974a5f1e [file] [log] [blame]
Greg Ward2689e3d1999-03-22 14:52:19 +00001"""distutils.errors
2
3Provides exceptions used by the Distutils modules. Note that Distutils
4modules may raise standard exceptions; in particular, SystemExit is
5usually raised for errors that are obviously the end-user's fault
6(eg. bad command-line arguments).
7
8This module safe to use in "from ... import *" mode; it only exports
9symbols whose names start with "Distutils" and end with "Error"."""
10
11# created 1999/03/03, Greg Ward
12
Greg Ward3ce77fd2000-03-02 01:49:45 +000013__revision__ = "$Id$"
Greg Ward2689e3d1999-03-22 14:52:19 +000014
Greg Wardccbb3f01999-07-10 02:01:44 +000015import types
Greg Ward2689e3d1999-03-22 14:52:19 +000016
Greg Wardccbb3f01999-07-10 02:01:44 +000017if type (RuntimeError) is types.ClassType:
Greg Ward2689e3d1999-03-22 14:52:19 +000018
19 # DistutilsError is the root of all Distutils evil.
20 class DistutilsError (Exception):
21 pass
22
23 # DistutilsModuleError is raised if we are unable to load an expected
24 # module, or find an expected class within some module
25 class DistutilsModuleError (DistutilsError):
26 pass
27
28 # DistutilsClassError is raised if we encounter a distribution or command
29 # class that's not holding up its end of the bargain.
30 class DistutilsClassError (DistutilsError):
31 pass
32
33 # DistutilsGetoptError (help me -- I have JavaProgrammersDisease!) is
34 # raised if the option table provided to fancy_getopt is bogus.
35 class DistutilsGetoptError (DistutilsError):
36 pass
37
38 # DistutilsArgError is raised by fancy_getopt in response to getopt.error;
39 # distutils.core then turns around and raises SystemExit from that. (Thus
40 # client code should never see DistutilsArgError.)
41 class DistutilsArgError (DistutilsError):
42 pass
43
44 # DistutilsFileError is raised for any problems in the filesystem:
45 # expected file not found, etc.
46 class DistutilsFileError (DistutilsError):
47 pass
48
49 # DistutilsOptionError is raised anytime an attempt is made to access
50 # (get or set) an option that does not exist for a particular command
51 # (or for the distribution itself).
52 class DistutilsOptionError (DistutilsError):
53 pass
54
Greg Ward8c66b691999-08-14 23:43:45 +000055 # DistutilsValueError is raised anytime an option value (presumably
56 # provided by setup.py) is invalid.
57 class DistutilsValueError (DistutilsError):
58 pass
59
Greg Wardccbb3f01999-07-10 02:01:44 +000060 # DistutilsPlatformError is raised when we find that we don't
61 # know how to do something on the current platform (but we do
62 # know how to do it on some platform).
63 class DistutilsPlatformError (DistutilsError):
64 pass
65
Greg Ward8c66b691999-08-14 23:43:45 +000066 # DistutilsExecError is raised if there are any problems executing
67 # an external program
68 class DistutilsExecError (DistutilsError):
69 pass
70
Greg Ward318a9d72000-03-31 02:57:31 +000071 # DistutilsInternalError is raised on internal inconsistencies
72 # or impossibilities
73 class DistutilsInternalError (DistutilsError):
74 pass
75
Greg Ward2689e3d1999-03-22 14:52:19 +000076# String-based exceptions
77else:
78 DistutilsError = 'DistutilsError'
79 DistutilsModuleError = 'DistutilsModuleError'
80 DistutilsClassError = 'DistutilsClassError'
81 DistutilsGetoptError = 'DistutilsGetoptError'
82 DistutilsArgError = 'DistutilsArgError'
83 DistutilsFileError = 'DistutilsFileError'
84 DistutilsOptionError = 'DistutilsOptionError'
Greg Ward8c66b691999-08-14 23:43:45 +000085 DistutilsValueError = 'DistutilsValueError'
Greg Wardccbb3f01999-07-10 02:01:44 +000086 DistutilsPlatformError = 'DistutilsPlatformError'
Greg Ward8c66b691999-08-14 23:43:45 +000087 DistutilsExecError = 'DistutilsExecError'
Greg Ward318a9d72000-03-31 02:57:31 +000088 DistutilsInternalError = 'DistutilsInternalError'
Greg Ward8c66b691999-08-14 23:43:45 +000089
Greg Wardccbb3f01999-07-10 02:01:44 +000090del types