summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-05-04 22:58:50 +0200
committeremkael <emkael@tlen.pl>2017-05-09 02:51:27 +0200
commitd5f023fbc96d6d6c4d8964032d23cf868ded2d3e (patch)
tree9f3971ccfcf8269c8f3e617376662a2b4916deca
parenta072bd51b80128690641c7dfa12d6f158b282806 (diff)
Goniec error handling
-rw-r--r--ausbutler/goniec.py13
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'