-
Notifications
You must be signed in to change notification settings - Fork 289
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
[LANGUAGE] improve clear errors #4826
Conversation
@@ -562,11 +562,15 @@ def parse(): | |||
|
|||
if transpile_result.has_turtle: | |||
response['has_turtle'] = True | |||
|
|||
if transpile_result.has_clear: | |||
response['has_clear'] = True | |||
except Exception: | |||
pass | |||
|
|||
with querylog.log_time('detect_sleep'): |
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.
@rix0rrr I don't think I understand what is happening here, and why, do you?
Firstly, why the exception? an "in" can't really fail, can it?
Secondly what does the logging do here exactly? Why do we need to log the time that this sleep checking occurs (if I understand correctly)
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.
I think the except
is there for safety. This used to be a function call.
The log_time
is there to measure how long it takes to do this, in case we need to investigate slowness. With the new code shape, probably not necessary anymore either.
Added a little pause to clear! I have not added a new exception for lonely clear, but I propose to do that separately because it will be large with new error messages. |
for more information, see https://pre-commit.ci
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.
It works!
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork). |
Some progress towards #4133.
This PR:
more clearly shows what is happening.
If doesn't do #4133 fully because a lonely clear also gives no error message anymore (hence don't close the issue)