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

[switchbot_ros] remove catching base exception and output more specific key error when the switchbot id not exists on the server #321

Merged
merged 1 commit into from Jan 18, 2022

Conversation

mqcmd196
Copy link
Member

@mqcmd196 mqcmd196 commented Jan 17, 2022

When publish the switchbot control action topic with switchbot device which not exists
before this PR

[ERROR] [WallTime: 1642402768.977277] [node:/switchbot_ros] [func:SwitchBotAction.execute_cb]: '/eng2/7f/73b2/light/upper/switch'

after this PR

[ERROR] [WallTime: 1642405853.687783] [node:/switchbot_ros] [func:SwitchBotAction.execute_cb]: 'Device name:/eng2/7f/73b2/light/upper/switch is not registered at switchbot server. Please check the setting.'

and also returns the action feedback status.
In addition I removed catching base exception part. cc:@708yamaguchi @tkmtnt7000

Copy link
Member

@708yamaguchi 708yamaguchi left a comment

Choose a reason for hiding this comment

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

Thank you very much for your PR.

It is very important for users to see the details of KeyError.

@mqcmd196 mqcmd196 force-pushed the PR/switchbot_ros/fix_exception branch from adf6a2a to f9bf77c Compare January 17, 2022 11:04
Copy link
Member

@708yamaguchi 708yamaguchi left a comment

Choose a reason for hiding this comment

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

I understand you fixed the variable name in the latest commit.

@mqcmd196 mqcmd196 changed the title [switchbot_ros] Catch more specific error and catch error when the switchbot id not exists on the server [switchbot_ros] remove catching base exception and output more specific key error when the switchbot id not exists on the server Jan 18, 2022
@k-okada k-okada merged commit 712cf10 into jsk-ros-pkg:master Jan 18, 2022
@mqcmd196 mqcmd196 deleted the PR/switchbot_ros/fix_exception branch February 2, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants