blob: 161705633c0ed95e28d5183debe70e8f41d3bed7 [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 Wardc1cb0492000-05-30 02:02:14 +000015class DistutilsError (Exception):
16 """The root of all Distutils evil."""
17 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000018
Greg Wardc1cb0492000-05-30 02:02:14 +000019class DistutilsModuleError (DistutilsError):
20 """Unable to load an expected module, or to find an expected class
21 within some module (in particular, command modules and classes)."""
22 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000023
Greg Wardc1cb0492000-05-30 02:02:14 +000024class DistutilsClassError (DistutilsError):
25 """Some command class (or possibly distribution class, if anyone
26 feels a need to subclass Distribution) is found not to be holding
27 up its end of the bargain, ie. implementing some part of the
28 "command "interface."""
29 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000030
Greg Wardc1cb0492000-05-30 02:02:14 +000031class DistutilsGetoptError (DistutilsError):
32 """The option table provided to 'fancy_getopt()' is bogus."""
33 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000034
Greg Wardc1cb0492000-05-30 02:02:14 +000035class DistutilsArgError (DistutilsError):
36 """Raised by fancy_getopt in response to getopt.error -- ie. an
37 error in the command line usage."""
38 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000039
Greg Wardc1cb0492000-05-30 02:02:14 +000040class DistutilsFileError (DistutilsError):
41 """Any problems in the filesystem: expected file not found, etc.
42 Typically this is for problems that we detect before IOError or
43 OSError could be raised."""
44 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000045
Greg Wardc1cb0492000-05-30 02:02:14 +000046class DistutilsOptionError (DistutilsError):
47 """Syntactic/semantic errors in command options, such as use of
48 mutually conflicting options, or inconsistent options,
49 badly-spelled values, etc. No distinction is made between option
50 values originating in the setup script, the command line, config
51 files, or what-have-you -- but if we *know* something originated in
52 the setup script, we'll raise DistutilsSetupError instead."""
53 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000054
Greg Wardc1cb0492000-05-30 02:02:14 +000055class DistutilsSetupError (DistutilsError):
56 """For errors that can be definitely blamed on the setup script,
57 such as invalid keyword arguments to 'setup()'."""
58 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000059
Greg Wardc1cb0492000-05-30 02:02:14 +000060class DistutilsPlatformError (DistutilsError):
61 """We don't know how to do something on the current platform (but
62 we do know how to do it on some platform) -- eg. trying to compile
63 C files on a platform not supported by a CCompiler subclass."""
64 pass
Greg Ward2689e3d1999-03-22 14:52:19 +000065
Greg Wardc1cb0492000-05-30 02:02:14 +000066class DistutilsExecError (DistutilsError):
67 """Any problems executing an external program (such as the C
68 compiler, when compiling C files)."""
69 pass
Greg Ward8c66b691999-08-14 23:43:45 +000070
Greg Wardc1cb0492000-05-30 02:02:14 +000071class DistutilsInternalError (DistutilsError):
72 """Internal inconsistencies or impossibilities (obviously, this
73 should never be seen if the code is working!)."""
74 pass
Greg Wardccbb3f01999-07-10 02:01:44 +000075
Greg Ward8c66b691999-08-14 23:43:45 +000076
Greg Wardc1cb0492000-05-30 02:02:14 +000077# Exception classes used by the CCompiler implementation classes
78class CCompilerError (Exception):
79 """Some compile/link operation failed."""
Greg Ward318a9d72000-03-31 02:57:31 +000080
Greg Wardc1cb0492000-05-30 02:02:14 +000081class CompileError (CCompilerError):
82 """Failure to compile one or more C/C++ source files."""
83
84class LibError (CCompilerError):
85 """Failure to create a static library from one or more C/C++ object
86 files."""
87
88class LinkError (CCompilerError):
89 """Failure to link one or more C/C++ object files into an executable
90 or shared library file."""
91
92