Error in console instead of throwing exception#178
Merged
jihoonl merged 3 commits intoRobotWebTools:developfrom Jun 27, 2017
Merged
Error in console instead of throwing exception#178jihoonl merged 3 commits intoRobotWebTools:developfrom
jihoonl merged 3 commits intoRobotWebTools:developfrom
Conversation
Since this is intended to be a warning, we can print a warning to the console instead of throwing an exception, which causes script execution to halt.
viktorku
approved these changes
Jun 9, 2017
Member
viktorku
left a comment
There was a problem hiding this comment.
lgtm
Can you run a grunt build and push that here for completeness before merging?
viktorku
suggested changes
Jun 9, 2017
src/sensors/Particles.js
Outdated
|
|
||
| if(n>particles.max_pts){ | ||
| throw 'Attempted to draw more points than max_pts allows'; | ||
| console.warn('Attempted to draw more points than max_pts allows'); |
Member
There was a problem hiding this comment.
I would make this console.error instead actually. Then the effect will be the same, but at least your script execution won't halt
Contributor
Author
|
Ran grunt build, could you take a look? |
Member
|
This PR includes unnecessary code-style changes that are irrelevant to |
Contributor
Author
|
Sorry, my editor did that. I force pushed an update to this branch without the formatting changes. |
Member
|
nice. Thanks. ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since this is intended to be a warning, we can print a warning to the console instead of throwing an exception. I encountered this exception with some normal-looking point clouds, and the exception caused my entire script execution to halt. I tried this change and the point clouds still rendered properly.