Esempio 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)
Esempio n. 2
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
Esempio n. 3
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
Esempio n. 4
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
Esempio n. 5
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))