2019-10-03 12:26:44 -04:00
|
|
|
class FatalError(RuntimeError):
|
|
|
|
"""
|
2019-11-18 11:34:33 -05:00
|
|
|
Wrapper class for runtime errors that aren't caused by bugs in idf.py or the build process.
|
2019-10-03 12:26:44 -04:00
|
|
|
"""
|
2019-07-23 15:37:31 -04:00
|
|
|
def __init__(self, message, ctx=None):
|
|
|
|
super(RuntimeError, self).__init__(message)
|
|
|
|
# if context is defined, check for the cleanup tasks
|
2021-01-25 21:49:01 -05:00
|
|
|
if ctx is not None and 'cleanup' in ctx.meta:
|
2019-07-23 15:37:31 -04:00
|
|
|
# cleans up the environment before failure
|
2021-01-25 21:49:01 -05:00
|
|
|
ctx.meta['cleanup']()
|