From 5ea13eeffd8c872159a4b8fb4173a375cd93a5ac Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 15 Jan 2014 21:51:27 +0100 Subject: [PATCH] Catch xbmc turned off error --- couchpotato/core/notifications/xbmc/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/notifications/xbmc/main.py b/couchpotato/core/notifications/xbmc/main.py index 759e43c3..b53485aa 100755 --- a/couchpotato/core/notifications/xbmc/main.py +++ b/couchpotato/core/notifications/xbmc/main.py @@ -8,6 +8,7 @@ import socket import traceback import urllib import requests +from requests.packages.urllib3.exceptions import MaxRetryError log = CPLog(__name__) @@ -168,7 +169,7 @@ class XBMC(Notification): # manually fake expected response array return [{'result': 'Error'}] - except requests.exceptions.Timeout: + except (MaxRetryError, requests.exceptions.Timeout): log.info2('Couldn\'t send request to XBMC, assuming it\'s turned off') return [{'result': 'Error'}] except: @@ -203,7 +204,7 @@ class XBMC(Notification): log.debug('Returned from request %s: %s', (host, response)) return response - except requests.exceptions.Timeout: + except (MaxRetryError, requests.exceptions.Timeout): log.info2('Couldn\'t send request to XBMC, assuming it\'s turned off') return [] except: