43 Exception.__init__(self, message)
95 def __init__(self, message='', test_timeout=True):
96 RobotError.__init__(self, message)
100 keyword_timeout = property
113 def __init__(self, message, test_timeout=False, keyword_timeout=False,
114 syntax=False, exit=False, continue_on_failure=False,
116 if '\r\n' in message:
117 message = message.replace(
'\r\n',
'\n')
134 dont_continue = property
140 continue_on_failure = property
145 @continue_on_failure.setter
149 for child
in getattr(self,
'_errors', []):
150 if child
is not self:
151 child.continue_on_failure = continue_on_failure
153 def can_continue(self, teardown=False, templated=False, dry_run=False):
183 error = details.error
184 timeout = isinstance(error, TimeoutError)
185 test_timeout = timeout
and error.test_timeout
186 keyword_timeout = timeout
and error.keyword_timeout
187 syntax = (isinstance(error, DataError)
188 and not isinstance(error, (KeywordError, VariableError)))
189 exit_on_failure = self.
_get_get(error,
'EXIT_ON_FAILURE')
190 continue_on_failure = self.
_get_get(error,
'CONTINUE_ON_FAILURE')
191 ExecutionFailed.__init__(self, details.message, test_timeout,
192 keyword_timeout, syntax, exit_on_failure,
198 return bool(getattr(error,
'ROBOT_' + attr,
False))
204 message = message
or self.
_format_message_format_message([e.message
for e
in errors])
205 ExecutionFailed.__init__(self, message, **self.
_get_attrs_get_attrs(errors))
209 if len(messages) == 1:
211 prefix =
'Several failures occurred:'
212 if any(msg.startswith(
'*HTML*')
for msg
in messages):
213 prefix =
'*HTML* ' + prefix
217 [
'%d) %s' % (i, m)
for i, m
in enumerate(messages, start=1)]
223 if msg.startswith(
'*HTML*'):
224 yield msg[6:].lstrip()
230 'test_timeout': any(e.test_timeout
for e
in errors),
231 'keyword_timeout': any(e.keyword_timeout
for e
in errors),
232 'syntax': any(e.syntax
for e
in errors),
233 'exit': any(e.exit
for e
in errors),
234 'continue_on_failure': all(e.continue_on_failure
for e
in errors)
243 def __init__(self, run_errors=None, teardown_errors=None):
245 message = self.
_get_message_get_message(run_errors, teardown_errors)
246 ExecutionFailures.__init__(self, errors, message)
247 if run_errors
and not teardown_errors:
253 return [err
for err
in errors
if err]
256 run_msg = run_errors.message
if run_errors
else ''
257 td_msg = teardown_errors.message
if teardown_errors
else ''
261 return 'Keyword teardown failed:\n%s' % td_msg
262 return '%s\n\nAlso keyword teardown failed:\n%s' % (run_msg, td_msg)
272 ExecutionStatus.__init__(self, message
or self.
_get_message_get_message(), **kwargs)
277 return (
"Invalid '%s' usage."
285 earlier_failures = property
303 ExecutionPassed.__init__(self, message)
317 def __init__(self, return_value=None, failures=None):
318 ExecutionPassed.__init__(self, return_value=return_value)
326 def __init__(self, message='', details='', fatal=False, continuable=False):
327 RobotError.__init__(self, message, details)
Used by 'Continue For Loop' keyword.
Used when variable does not exist.
Used for communicating failures in test execution.
def _get_attrs(self, errors)
def _format_html_messages(self, messages)
def _format_message(self, messages)
def __init__(self, errors, message=None)
Base class for all exceptions communicating that execution passed.
def set_earlier_failures(self, failures)
def __init__(self, message=None, **kwargs)
def __init__(self, message, test_timeout=False, keyword_timeout=False, syntax=False, exit=False, continue_on_failure=False, return_value=None)
def continue_on_failure(self, continue_on_failure)
def continue_on_failure(self)
def can_continue(self, teardown=False, templated=False, dry_run=False)
Used by 'Return From Keyword' keyword.
Can be used when the core framework goes to unexpected state.
def _get(self, error, attr)
def __init__(self, details)
Used when a test or keyword timeout occurs.
Used by 'Pass Execution' keyword.
def __init__(self, message)
Used by Remote library to report remote errors.
def __init__(self, message='', details='', fatal=False, continuable=False)
ROBOT_CONTINUE_ON_FAILURE
def __init__(self, return_value=None, failures=None)
Base class for Robot Framework errors.
def __init__(self, message='', details='')
def __init__(self, message='', test_timeout=True)
def _get_active_errors(self, *errors)
def __init__(self, run_errors=None, teardown_errors=None)
def _get_message(self, run_errors, teardown_errors)
Used when no keyword is found or there is more than one match.
unicode
Exceptions and return codes used internally.
def html_escape(text, linkify=True)
def printable_name(string, code_style=False)
Generates and returns printable name from the given string.
def cut_long_message(msg)