Lines Matching full:exception
21 class StepFailure(Exception):
33 # The constants.EXCEPTION_CATEGORY_ALL_CATEGORIES values that this exception
62 # A namedtuple to hold information of an exception.
67 def CreateExceptInfo(exception, tb): argument
68 """Creates a list of ExceptInfo objects from |exception| and |tb|.
70 Creates an ExceptInfo object from |exception| and |tb|. If
71 |exception| is a CompoundFailure with non-empty list of exc_infos,
72 simly returns exception.exc_infos. Note that we do not preserve type
73 of |exception| in this case.
76 exception: The exception.
82 if isinstance(exception, CompoundFailure) and exception.exc_infos:
83 return exception.exc_infos
85 return [ExceptInfo(exception.__class__, str(exception), tb)]
89 """An exception that contains a list of ExceptInfo objects."""
138 whitelist: A list of whitelisted exception types.
184 class ExitEarlyException(Exception):
185 """Exception when a stage finishes and exits early."""
188 # from BaseException, so should not catch ExitEarlyException as Exception
193 """A wrapper to re-raise the exception as the pre-set type."""
200 category_exception: The exception type to re-raise as. It must be
202 source_exception: The exception types to re-raise. By default, re-raise
203 all Exception classes.
204 exclude_exceptions: Do not set the type of the exception if it's subclass
205 of one exception in exclude_exceptions. Default to EXCLUSIVE_EXCEPTIONS.
211 self.source_exception = Exception
220 # Get the information about the original exception.
228 # Do not re-raise if the exception is a subclass of the set
229 # exception type because it offers more information.
239 """This exception is thrown when a step failed, but should be retried."""
245 """This exception is thrown when a build command failed.
255 def __init__(self, exception, shortname): argument
259 exception: A RunCommandError object.
263 assert isinstance(exception, cros_build_lib.RunCommandError)
264 self.exception = exception
266 self.args = (exception, shortname)
270 result = self.exception.result
274 return self.exception.msg
291 """This exception is thrown when packages fail to build."""
293 def __init__(self, exception, shortname, failed_packages): argument
297 exception: The underlying exception.
301 BuildScriptFailure.__init__(self, exception, shortname)
303 self.args = (exception, shortname, failed_packages)
411 def ReportStageFailure(exception, metrics_fields=None): argument
415 exception: The failure exception to report.
419 exception_category=_GetExceptionCategory(type(exception)),
423 if isinstance(exception, CompoundFailure):
424 for exc_class, _, _ in exception.exc_infos:
449 exception, stage_prefix_name=None): argument
450 """Get StageFailureMessage from an exception.
455 exception: The BaseException instance to convert to StageFailureMessage.
462 if isinstance(exception, StepFailure):
463 return exception.ConvertToStageFailureMessage(
467 None, build_stage_id, None, type(exception).__name__, str(exception),
468 _GetExceptionCategory(type(exception)), None, None, stage_name,