-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve BuiltIn.Evaluate error messages #1798
Improve BuiltIn.Evaluate error messages #1798
Conversation
For issue robotframework#1795 - improve error messages for empty/nonstring expressions
Admin, can CI be enabled? |
return eval(expression, namespace) | ||
except: | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pekkaklarck I changed this because an unspecified except:
is generally avoided in Python, but I'm not completely sure if it was intentional in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, using except:
here and in many other places in Robot code base is intentional. The reason is that Java based exceptions are not based on Exception
and thus go through except Exception:
. The problem with plain except:
is that it catches also SystemExit
and KeyboardInterrupt
, but this is handled by utils.get_error_message/details
that reraises them and that ought to be used everywhere where plain except:
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. I'll change it back.
Does this work for non-admin users? @robotci: once |
Tests passed. Refer to this link for build results (access rights to CI server needed): |
@robotci: once |
Tests passed. Refer to this link for build results (access rights to CI server needed): |
@guykisel: I think you don't need to explicitly tell CI to run tests now that you are whitelisted. All your PRs ought to be run automatically. Or how was it @jussimalinen? Also, what was the method to avoid running tests if there is no need? We definitely need to list all commands somewhere. CONTRIBUTING.rst is probably the best place once we have written it, and until that listing them in a comment to #1768 is probably the easiest solution. |
Improve BuiltIn.Evaluate error messages. Affects also all keywords that use it internally (e.g. `Should Be True`, `Run Keyword If`).
For issue #1795 - improve error messages for empty/nonstring expressions