Catch invalid path in build method

The server responds with an unuseful message (server error EOF), which
happens because an empty tar file is sent over. So check in the client,
who knows why that's happening and tell the user.
This commit is contained in:
Heewa Barfchin 2014-10-04 18:14:23 -04:00
parent 7a46297085
commit 39e19c18b8
1 changed files with 2 additions and 0 deletions

View File

@ -395,6 +395,8 @@ class Client(requests.Session):
elif path.startswith(('http://', 'https://',
'git://', 'github.com/')):
remote = path
elif not os.path.isdir(path):
raise TypeError("You must specify a directory to build in path")
else:
dockerignore = os.path.join(path, '.dockerignore')
exclude = None