tool_communication.py: Add error handling for non-existing parent#477
Merged
urfeex merged 3 commits intoUniversalRobots:masterfrom Mar 31, 2026
Merged
Conversation
When passing a path as a local device name where the parent directory doesn't exist, socat complains about the link target not existing. From that it isn't necessary clear that this means that the **parent** directory doesn't exist. This commit adds a check for that case explicitly with a clear error message.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #477 +/- ##
==========================================
- Coverage 77.04% 76.90% -0.14%
==========================================
Files 110 111 +1
Lines 5824 5902 +78
Branches 2577 2576 -1
==========================================
+ Hits 4487 4539 +52
- Misses 997 1023 +26
Partials 340 340
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a171ecb to
e801e30
Compare
srvald
approved these changes
Mar 31, 2026
Contributor
srvald
left a comment
There was a problem hiding this comment.
Looks good to me.
Thank you for improving the error handling by switching to exceptions and for adding tests.
The additional check ensuring that the parent directory exists makes sense and is something I hadn't taken into account, so thanks for adding that error case.
urrsk
approved these changes
Mar 31, 2026
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.
When passing a path as a local device name where the parent directory doesn't exist, socat complains about the link target not existing. From that it isn't necessary clear that this means that the parent directory doesn't exist. This commit adds a check for that case explicitly with a clear error message.
Without this PR
Without the changes from this PR passing a non-existing parent folder will look like this:
With this PR
With the changes from this PR passing a non-existing parent folder will look like this: