Ejemplo n.º 1
0
 def __exit__(self, etype, error, tb):
     if error is None:
         return
     if not isinstance(error, ExecutionStatus):
         error = HandlerExecutionFailed(ErrorDetails(error))
     if error.can_continue(self._context):
         self.assign(error.return_value)
Ejemplo n.º 2
0
 def _report_failure(self, context):
     failure = HandlerExecutionFailed()
     if not failure.exit_for_loop:
         context.output.fail(failure.full_message)
         if failure.traceback:
             context.output.debug(failure.traceback)
     raise failure
Ejemplo n.º 3
0
 def _get_and_report_failure(self):
     failure = HandlerExecutionFailed(ErrorDetails())
     if failure.timeout:
         self._context.timeout_occurred = True
     self._context.fail(failure.full_message)
     if failure.traceback:
         self._context.debug(failure.traceback)
     return failure
Ejemplo n.º 4
0
 def _report_failure(self, context):
     failure = HandlerExecutionFailed()
     if failure.timeout:
         context.timeout_occurred = True
     context.output.fail(failure.full_message)
     if failure.traceback:
         context.output.debug(failure.traceback)
     raise failure
Ejemplo n.º 5
0
 def _get_failure(self, exc_type, exc_value, exc_tb, context):
     if exc_value is None:
         return None
     if isinstance(exc_value, ExecutionFailed):
         return exc_value
     if isinstance(exc_value, DataError):
         msg = exc_value.message
         context.fail(msg)
         return ExecutionFailed(msg, syntax=exc_type is not VariableError)
     exc_info = (exc_type, exc_value, exc_tb)
     failure = HandlerExecutionFailed(ErrorDetails(exc_info))
     if failure.timeout:
         context.timeout_occurred = True
     context.fail(failure.full_message)
     if failure.traceback:
         context.debug(failure.traceback)
     return failure
Ejemplo n.º 6
0
 def _get_failure(self, exc_type, exc_value, exc_tb, context):
     if exc_value is None:
         return None
     if isinstance(exc_value, ExecutionStatus):
         return exc_value
     if isinstance(exc_value, DataError):
         msg = exc_value.message
         context.fail(msg)
         syntax = not isinstance(exc_value, (KeywordError, VariableError))
         return ExecutionFailed(msg, syntax=syntax)
     error = ErrorDetails(exc_value)
     failure = HandlerExecutionFailed(error)
     if failure.timeout:
         context.timeout_occurred = True
     if failure.skip:
         context.skip(error.message)
     else:
         context.fail(error.message)
     if error.traceback:
         context.debug(error.traceback)
     return failure
Ejemplo n.º 7
0
 def _get_failure(self, exc_type, exc_val, exc_tb):
     if isinstance(exc_val, ExecutionFailed):
         return exc_val
     exc_info = (exc_type, exc_val, exc_tb)
     return HandlerExecutionFailed(ErrorDetails(exc_info))