Skip to content

Commit 270375d

Browse files
feat(client): Add error message when writing settings fails.
1 parent fe46f38 commit 270375d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

client/deis.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,13 @@ def save(self):
201201
Serialize and save settings to the filesystem
202202
"""
203203
data = json.dumps(dict(self))
204-
with open(self._path, 'w') as f:
205-
f.write(data)
204+
try:
205+
with open(self._path, 'w') as f:
206+
f.write(data)
207+
except IOError:
208+
self._logger.error("Could not write to settings file at '~/.deis/client.json'. \
209+
Do you have the right file permissions?")
210+
sys.exit(1)
206211
return data
207212

208213

0 commit comments

Comments
 (0)