errors.py 443 B

12345678910
  1. class FatalError(RuntimeError):
  2. """
  3. Wrapper class for runtime errors that aren't caused by bugs in idf.py or the build process.
  4. """
  5. def __init__(self, message, ctx=None):
  6. super(RuntimeError, self).__init__(message)
  7. # if context is defined, check for the cleanup tasks
  8. if ctx is not None and "cleanup" in ctx.meta:
  9. # cleans up the environment before failure
  10. ctx.meta["cleanup"]()