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

Initialized receive timeout and changed exception to warning #118

Merged

Conversation

urmarp
Copy link
Contributor

@urmarp urmarp commented Sep 26, 2022

This will fix issue #115

Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

It definitively makes sense to initialize the timeout by default.

Concerning the exception vs. warning output: It probably is a matter of control flow definition. The aim was that if the read fails, we clearly communicate that to the caller. By simply returning an empty string the caller has to explicitly check whether the returned string does make sense. A simple check against an empty string might be misleading, as this would require that a dashboard call would never return an empty string (which might be true, actually). By throwing an exception a caller can make a distinct decision what to do in that case by defining an exit strategy inside a try/catch block.

Just for the sake of clarity: I'm not saying that this is the one and only way to handle this, but this is a workflow we've used at multiple parts of this library, so far.

Copy link
Collaborator

@fmauch fmauch 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 @urmarp

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Base: 41.13% // Head: 51.15% // Increases project coverage by +10.02% 🎉

Coverage data is based on head (77113ce) compared to base (f31f998).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #118       +/-   ##
===========================================
+ Coverage   41.13%   51.15%   +10.02%     
===========================================
  Files          76       82        +6     
  Lines        2064     2465      +401     
  Branches      256      279       +23     
===========================================
+ Hits          849     1261      +412     
+ Misses       1102     1072       -30     
- Partials      113      132       +19     
Impacted Files Coverage Δ
src/ur/dashboard_client.cpp 0.00% <0.00%> (ø)
src/comm/tcp_server.cpp 76.74% <0.00%> (-0.78%) ⬇️
src/ur/ur_driver.cpp 0.00% <0.00%> (ø)
src/rtde/data_package.cpp 62.50% <0.00%> (ø)
include/ur_client_library/types.h 0.00% <0.00%> (ø)
include/ur_client_library/ur/ur_driver.h 0.00% <0.00%> (ø)
include/ur_client_library/comm/tcp_socket.h 0.00% <0.00%> (ø)
include/ur_client_library/comm/tcp_server.h 100.00% <0.00%> (ø)
tests/test_reverse_interface.cpp 97.18% <0.00%> (ø)
src/control/script_command_interface.cpp 0.00% <0.00%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fmauch fmauch merged commit 3ba86f5 into UniversalRobots:master Oct 4, 2022
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.

None yet

2 participants