From 80317e48ccf0286330fa684ae3acc6e9feeca377 Mon Sep 17 00:00:00 2001 From: Tilman Date: Fri, 3 Nov 2017 21:01:05 +0100 Subject: [PATCH] bugfix-bugfix --- code/piplayer3.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/piplayer3.py b/code/piplayer3.py index 18b1eca..12b26fc 100644 --- a/code/piplayer3.py +++ b/code/piplayer3.py @@ -69,9 +69,8 @@ def call(method, params=None): try: response = requests.post(MOPIDY_RPC_URL, data=json, timeout=REQUEST_TIMEOUT) logging.info('Response: ' + response.text) - except Exception as ex: - logging.error('Exeption during request') - logging.error(ex.output) + except requests.exceptions.Timeout: + logging.error('The request timed out') return response @@ -174,7 +173,7 @@ try: response = requests.post(MOPIDY_RPC_URL, data='{"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.clear"}', timeout=REQUEST_TIMEOUT) except: logging.debug("Timeout while connecting to the server") - time.sleep(1) + time.sleep(5) continue play_sound(SOUND_OK)