Fix invalid session bad error description#2181
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2181 +/- ##
==========================================
- Coverage 89.85% 89.65% -0.20%
==========================================
Files 73 73
Lines 19006 19048 +42
==========================================
+ Hits 17077 17078 +1
- Misses 1929 1970 +41
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
3c6da41 to
ab14a93
Compare
| error_string = self.error_message(error_code) | ||
| return error_string | ||
| except errors.Error: | ||
| pass |
There was a problem hiding this comment.
It is possible that the session is valid but the returned_error_code unequal to error_code
If this happens, then something likely went wrong retrieving the error message. I'm not sure calling error_message instead of get_error_description is going to change anything in that case.
| self.set_session_handle() | ||
| error_string = self.error_message(error_code) |
There was a problem hiding this comment.
Did you add the other error_message call to protect against resetting the session handle in instances where the session is valid but we fail to retrieve the error message?
There was a problem hiding this comment.
My current approach is wrong because it reset valid session. Adding error_message call will not help to protect against it because it is unable to know error_message throw exception because of invalid session or any other internal error. Maybe I should compare its error code directly with the invalid error session code?
|
FYI @zoechanzy , our Linux VM is currently in bad shape, so Linux System tests are going to fail. We hope to have it resolved in the next week or two. |
| pass | ||
|
|
||
| try: | ||
| ''' |
There was a problem hiding this comment.
FYI, it's weird that these are multi-line string literals instead of comments. They are not in a position where they will be interpreted as docstrings.
There was a problem hiding this comment.
Yeah, that struck me as odd, too.
Apparently the Python interpreter will evaluate it as a string and then discard it?
There was a problem hiding this comment.
Yes, it will.
BTW it's legal to write a docstring inside an init method, e.g. https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html
self.attr5 = None
"""str: Docstring *after* attribute, with type specified."""
But that's not what's being done here.
This contribution adheres to CONTRIBUTING.md.
I've updated CHANGELOG.md if applicable.
I've added tests applicable for this pull request
What does this Pull Request accomplish?
List issues fixed by this Pull Request below, if any.
What testing has been done?