Skip to content

Error in console instead of throwing exception#178

Merged
jihoonl merged 3 commits intoRobotWebTools:developfrom
jstnhuang:patch-1
Jun 27, 2017
Merged

Error in console instead of throwing exception#178
jihoonl merged 3 commits intoRobotWebTools:developfrom
jstnhuang:patch-1

Conversation

@jstnhuang
Copy link
Contributor

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.

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.
Copy link
Member

@viktorku viktorku left a comment

Choose a reason for hiding this comment

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

lgtm
Can you run a grunt build and push that here for completeness before merging?


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');
Copy link
Member

Choose a reason for hiding this comment

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

I would make this console.error instead actually. Then the effect will be the same, but at least your script execution won't halt

@jstnhuang
Copy link
Contributor Author

Ran grunt build, could you take a look?

@jihoonl
Copy link
Member

jihoonl commented Jun 26, 2017

This PR includes unnecessary code-style changes that are irrelevant to Warn in console instead of throwing exception. It makes hard to review what this PR brings in. Could you change only relevant part for the PR? I would be happy to review code style change with another PR. :)

@jstnhuang
Copy link
Contributor Author

Sorry, my editor did that. I force pushed an update to this branch without the formatting changes.

@jihoonl jihoonl changed the title Warn in console instead of throwing exception Error in console instead of throwing exception Jun 27, 2017
@jihoonl
Copy link
Member

jihoonl commented Jun 27, 2017

nice. Thanks. ;)

@jihoonl jihoonl merged commit 0a66caf into RobotWebTools:develop Jun 27, 2017
@jstnhuang jstnhuang deleted the patch-1 branch June 27, 2017 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants