Skip to content
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

RobotError: Fix __repr__()/__str__() issue. #23

Merged
merged 2 commits into from
Jun 24, 2017

Commits on Jun 20, 2017

  1. RobotError: Fix __repr__()/__str__() issue.

    Commit 280f8d3 already tried to improve this, but the reliable way
    to render an exception message is to pass it as the first argument
    to the `Exception` superclass constructor; see:
    https://stackoverflow.com/questions/1319615/proper-way-to-declare-custom-exceptions-in-modern-python
    
    This guarantees that both `repr()` and `str()` are set as expected.
    
    Until now, for example, `repr()` did not actually render the exception
    name "RobotError", which was confusing, as all other Python exceptions
    do that, and the docs say that it should.
    Similarly, the fix from 280f8d3 actually broke the `str()`, which
    until now was just `RobotError()`.
    This commit fixes both these issues.
    nh2 committed Jun 20, 2017
    Configuration menu
    Copy the full SHA
    330ce55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e233c70 View commit details
    Browse the repository at this point in the history