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

Fix #7087: Add log for "contains no units" SyntaxError #7157

Merged
merged 18 commits into from
Jul 18, 2019

Conversation

kevintab95
Copy link
Member

Explanation

Fixes #7087: Added a try-catch to additionally log the actual input string and parameter passed to math.unit(). This information will help us reproduce the issue.

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The linter/Karma presubmit checks have passed.
    • These should run automatically, but if not, you can manually trigger them locally using python scripts/pre_commit_linter.py and bash scripts/run_frontend_tests.sh.
  • The PR is made from a branch that's not called "develop".
  • The PR has an appropriate "CHANGELOG: ..." label (If you are unsure of which label to add, ask the reviewers for guidance).
  • The PR follows the style guide.
  • The PR addresses the points mentioned in the codeowner checks for the files/folders changed. (See the codeowner's wiki page.)
  • The PR is assigned to an appropriate reviewer.
    • If you're a new contributor, please ask on Gitter for someone to assign a reviewer and don't tick this checkbox.
    • If you're not sure who the appropriate reviewer is, please assign to the issue's "owner" -- see the "talk-to" label on the issue. Do not only request the review but also add the reviewer as an assignee.

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @kevintab95! But one question: do you need any info about earlierInputString?

@codecov
Copy link

codecov bot commented Jul 17, 2019

Codecov Report

Merging #7157 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #7157      +/-   ##
===========================================
- Coverage    86.92%   86.92%   -0.01%     
===========================================
  Files          941      941              
  Lines        85507    85511       +4     
  Branches      2727     2727              
===========================================
+ Hits         74331    74332       +1     
- Misses       11176    11179       +3
Impacted Files Coverage Δ
...its/directives/NumberWithUnitsValidationService.ts 94.54% <100%> (-5.46%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea2a0db...2471800. Read the comment docs.

@kevintab95
Copy link
Member Author

I guess laterInputString can be derived from laterInput. I've removed that. Thanks!

Copy link
Contributor

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@seanlip
Copy link
Member

seanlip commented Jul 17, 2019

Hi @kevintab95 -- just to clarify, I meant, "should we also log earlierInputString" as opposed to "should we remove laterInputString"...

Copy link
Contributor

@kevinlee12 kevinlee12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@kevinlee12
Copy link
Contributor

@seanlip, can this be merged as-is or do you want more work on this?

@seanlip
Copy link
Member

seanlip commented Jul 17, 2019

Let's not merge it just yet -- I want to get confirmation that @kevintab95 is happy with it (in light of my last comment). If he is then we can merge it. Thanks for checking!

@kevintab95
Copy link
Member Author

Oh I missed that, I see what you mean now. I've logged earlierInput as well. Thanks @seanlip!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @kevintab95 !

@DubeySandeep
Copy link
Member

@nithusha21, I'm not sure whether I should add "Bug fixes" label to this PR. Do you have any suggestion?

@seanlip
Copy link
Member

seanlip commented Jul 18, 2019

Hm good point, I put it under "infrastructural changes" as it's adding logging. Thanks for checking! Will merge it now.

@seanlip seanlip merged commit 1ec3f47 into oppia:develop Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SyntaxError: "2" contains no units
5 participants