3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
7 # Thomas Nagy, 2010-2016 (ita)
10 Exceptions used in the Waf code
15 class WafError(Exception):
16 """Base class for all Waf errors"""
17 def __init__(self, msg='', ex=None):
19 :param msg: error message
21 :param ex: exception causing this error (optional)
25 assert not isinstance(msg, Exception)
31 if isinstance(ex, WafError):
34 self.stack = traceback.extract_tb(sys.exc_info()[2])
35 self.stack += traceback.extract_stack()[:-1]
36 self.verbose_msg = ''.join(traceback.format_list(self.stack))
41 class BuildError(WafError):
42 """Error raised during the build and install phases"""
43 def __init__(self, error_tasks=[]):
45 :param error_tasks: tasks that could not complete normally
46 :type error_tasks: list of task objects
48 self.tasks = error_tasks
49 WafError.__init__(self, self.format_error())
51 def format_error(self):
52 """Formats the error messages from the tasks that failed"""
53 lst = ['Build failed']
54 for tsk in self.tasks:
55 txt = tsk.format_error()
56 if txt: lst.append(txt)
59 class ConfigurationError(WafError):
60 """Configuration exception raised in particular by :py:meth:`waflib.Context.Context.fatal`"""
63 class TaskRescan(WafError):
64 """Task-specific exception type signalling required signature recalculations"""
67 class TaskNotReady(WafError):
68 """Task-specific exception type signalling that task signatures cannot be computed"""