diff options
-rw-r--r-- | ausbutler/goniec.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ausbutler/goniec.py b/ausbutler/goniec.py index 247c5f8..b25ded2 100644 --- a/ausbutler/goniec.py +++ b/ausbutler/goniec.py @@ -9,8 +9,11 @@ class Goniec(object): def send(self, files): if self.config['enabled']: - content_lines = [Constants.path] + files + ['bye', ''] - goniec = socket.socket() - goniec.connect((self.config['host'], self.config['port'])) - goniec.sendall('\n'.join(content_lines)) - goniec.close() + try: + content_lines = [Constants.path] + files + ['bye', ''] + goniec = socket.socket() + goniec.connect((self.config['host'], self.config['port'])) + goniec.sendall('\n'.join(content_lines)) + goniec.close() + except socket.error: + print 'WARNING: unable to send files via Goniec' |