robotframework-robocop icon indicating copy to clipboard operation
robotframework-robocop copied to clipboard

Wrap Robot Framework fatal error

Open bhirsz opened this issue 2 years ago • 0 comments

If there was fatal issue in RF parsing module and somebody uses Robocop with older (bugged) version, Robocop will fail with Robot Framework stack trace. For example empty arguments cause crash with RF 4.1.3: https://github.com/robotframework/robotframework/blob/master/atest/testdata/parsing/user_keyword_settings.robot

It was fixed it 5.0. If I run robocop with 4.1.3 it will result in following:

(dozens of lines)
  File "c:\users\barte\appdata\local\programs\python\python39\lib\site-packages\robot\parsing\model\blocks.py", line 239, in visit_Statement
    node.validate()
  File "c:\users\barte\appdata\local\programs\python\python39\lib\site-packages\robot\parsing\model\statements.py", line 699, in validate
    UserKeywordArgumentParser(error_reporter=errors.append).parse(self.values)
  File "c:\users\barte\appdata\local\programs\python\python39\lib\site-packages\robot\running\arguments\argumentparser.py", line 118, in parse
    elif self._is_kwargs(arg):
  File "c:\users\barte\appdata\local\programs\python\python39\lib\site-packages\robot\running\arguments\argumentparser.py", line 215, in _is_kwargs
    return arg[0] == '&'

It may led people to believe that it's Robocop not working while it's RF itself.

It should be:

(stack trace)
Fatal exception occured when using Robot Framework parsing module. Consider updating Robot Framework to recent stable version. 

bhirsz avatar Mar 24 '22 18:03 bhirsz