mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-11 20:05:04 -05:00
Added exception catching for timeouts to notifiers
This commit is contained in:
parent
65eda93b2b
commit
6ce43c7782
@ -16,6 +16,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import socket
|
||||
from httplib import HTTPSConnection, HTTPException
|
||||
from urllib import urlencode
|
||||
|
||||
@ -87,7 +88,7 @@ class ProwlNotifier:
|
||||
"/publicapi/add",
|
||||
headers={'Content-type': "application/x-www-form-urlencoded"},
|
||||
body=urlencode(data))
|
||||
except (SSLError, HTTPException):
|
||||
except (SSLError, HTTPException, socket.error):
|
||||
logger.log(u"Prowl notification failed.", logger.ERROR)
|
||||
return False
|
||||
response = http_handler.getresponse()
|
||||
|
@ -17,6 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import socket
|
||||
from httplib import HTTPSConnection, HTTPException
|
||||
from urllib import urlencode
|
||||
from ssl import SSLError
|
||||
@ -77,7 +78,7 @@ class PushalotNotifier:
|
||||
"/api/sendmessage",
|
||||
headers={'Content-type': "application/x-www-form-urlencoded"},
|
||||
body=urlencode(data))
|
||||
except (SSLError, HTTPException):
|
||||
except (SSLError, HTTPException, socket.error):
|
||||
logger.log(u"Pushalot notification failed.", logger.ERROR)
|
||||
return False
|
||||
response = http_handler.getresponse()
|
||||
|
@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import socket
|
||||
import base64
|
||||
from httplib import HTTPSConnection, HTTPException
|
||||
import json
|
||||
@ -86,7 +86,7 @@ class PushbulletNotifier:
|
||||
try:
|
||||
logger.log(u"Testing Pushbullet authentication and retrieving the device list.", logger.DEBUG)
|
||||
http_handler.request(method, uri, None, headers={'Authorization': 'Basic %s:' % authString})
|
||||
except (SSLError, HTTPException):
|
||||
except (SSLError, HTTPException, socket.error):
|
||||
logger.log(u"Pushbullet notification failed.", logger.ERROR)
|
||||
return False
|
||||
else:
|
||||
@ -101,7 +101,7 @@ class PushbulletNotifier:
|
||||
http_handler.request(method, uri, body=data,
|
||||
headers={'Content-Type': 'application/json', 'Authorization': 'Basic %s' % authString})
|
||||
pass
|
||||
except (SSLError, HTTPException):
|
||||
except (SSLError, HTTPException, socket.error):
|
||||
return False
|
||||
|
||||
response = http_handler.getresponse()
|
||||
|
Loading…
Reference in New Issue
Block a user