Skip to content

Commit

Permalink
Improves container error message for easier debugging
Browse files Browse the repository at this point in the history
In case the engine is not shut down correctly, config and data
container folders are left in their directories, making it impossible to
execute the same code again after a problematic exit. The new error
message containes the path to the folder where the container
directories reside.

In order to prevent people deleting directories that are still in use,
 a short informative message is also provided.

This addresses but does not solve issue rapyuta-robotics#39
  • Loading branch information
micpalmia committed Sep 17, 2013
1 parent e8ad179 commit 9c3584f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rce-core/rce/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ def __init__(self, client, nr, uid, data):

if os.path.isdir(confDir):
raise ValueError('There is already a configuration directory for '
"'{0}'.".format(name))
"'{0}' \n Please remove it manually if the engine "
'did not shut down correctly on last execution and '
'you are sure it is not in use. \n dir: {1}.'.format(name, confDir))

if os.path.isdir(dataDir):
raise ValueError('There is already a data directory for '
"'{0}'.".format(name))

"'{0}' \n Please remove it manually if the engine "
'did not shut down correctly on last execution and '
'you are sure it is not in use. \n dir: {1}.'.format(name, dataDir))
os.mkdir(confDir)
os.mkdir(dataDir)

Expand Down

0 comments on commit 9c3584f

Please sign in to comment.