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

Clarify the reason of the error due to wrong pkgpath passed. #57

Merged

Conversation

130s
Copy link
Contributor

@130s 130s commented Sep 11, 2017

Issue
When the path passed to pkgpath does NOT start from the path of the directory of the package your upstart launch is located at, the following error occurs, which does not provide enough info why failing.

$ rosrun robot_upstart install catkin_ws/src/foo/foo_support/launch/upstart.launch --user autoboot --setup /etc/ros/setup.bash
Unable to locate path src/foo/foo_support/launch/upstart.launch in package catkin_ws. Installation aborted.
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/robot_upstart/install", line 32, in <module>
    exit(main())
  File "/opt/ros/indigo/lib/python2.7/dist-packages/robot_upstart/install_script.py", line 80, in main
    if os.path.isfile(found_path[0]):
      IndexError: list index out of range

Solution
In the error message, clearly instruct what path should be passed.
Also add more description to the result of "help".

Output example

$ rosrun robot_upstart install /home/ros/catkin_ws/src/foo/foo_support/launch/upstart.launch --user autoboot --setup /etc/ros/setup.bash
Unable to locate package your job launch is in. Installation aborted. Make sure the path starts with the package name (e.g. don't pass absolute path nor a path starting from workspace top folder etc.)
pkgpath passed: home/ros/foo_ws/src/foo/foo_support/launch/upstart.launch.

**Issue**
When the path passed to pkgpath does NOT start from the path of the directory of the package your upstart launch is located at, the following error occurs, which does not provide enough info why failing.

```
$ rosrun robot_upstart install catkin_ws/src/foo/foo_support/launch/upstart.launch --user autoboot --setup /etc/ros/setup.bash
Unable to locate path src/foo/foo_support/launch/upstart.launch in package catkin_ws. Installation aborted.
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/robot_upstart/install", line 32, in <module>
    exit(main())
  File "/opt/ros/indigo/lib/python2.7/dist-packages/robot_upstart/install_script.py", line 80, in main
    if os.path.isfile(found_path[0]):
      IndexError: list index out of range
```

**Solution**
In the error message, clearly instruct what path should be passed.
Also add more description to the result of "help".
@mikepurvis
Copy link
Member

Looks reasonable, thanks!

@mikepurvis mikepurvis merged commit 8ed6882 into clearpathrobotics:jade-devel Sep 11, 2017
@130s 130s deleted the j/temporary_comparison_bolles branch September 11, 2017 22:32
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