Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
SonarLint pass against detected bugs and code smell issues #3135
SonarLint pass against detected bugs and code smell issues #3135
Changes from all commits
dd804b2
26bfbe3
3716830
38163e2
c69f736
60fb07c
fc9711b
eada507
b53c223
789dbbc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 agree that anything throwing an error should
throw new Error('....')
. But...we haven't always done that. Have you verified that any code that will catch this error is expecting an error object and not just a string?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 passes the test suite, and I made this change aside from the other issues we were having with P42 if-else changes that I have Lars looking at.
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.
Our test suite isn't complete, and is not alone good enough to validate a change like this. Either do the legwork or revert this change.
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.
If anything, we're not even utilizing the full power of Error here; there are newer ES20xx commands that can do error handling like you would in C#, Nim, or other languages. And I don't see much "catch" of throws, either. This still seems legit to me.
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.
You're preaching at the choir. The question was never whether or not this was legit or a good idea. The question is whether or not this BREAKS OUR CODE because the caller(s) of this function are expecting a different type of throw. If they are, more changes are required.
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.
@msimerson sorry I didn't see this sooner; I wasn't getting fully updated with notifications. I have everything else fixed so far; I'll dig into this in a bit. Thank you for your extreme patience.