mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Fix for sickragetv/sickrage-issues#164 - ensures result.hash is never NoneType for when attempting to raise exceptions.
This commit is contained in:
parent
042c3f4287
commit
340bcffc91
@ -106,6 +106,12 @@ class SearchResult:
|
|||||||
# version
|
# version
|
||||||
self.version = -1
|
self.version = -1
|
||||||
|
|
||||||
|
# hash
|
||||||
|
self.hash = ""
|
||||||
|
|
||||||
|
# content
|
||||||
|
self.content = ""
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
||||||
if self.provider is None:
|
if self.provider is None:
|
||||||
@ -148,10 +154,6 @@ class TorrentSearchResult(SearchResult):
|
|||||||
"""
|
"""
|
||||||
resultType = "torrent"
|
resultType = "torrent"
|
||||||
|
|
||||||
# torrent hash
|
|
||||||
content = None
|
|
||||||
hash = None
|
|
||||||
|
|
||||||
|
|
||||||
class AllShowsListUI:
|
class AllShowsListUI:
|
||||||
"""
|
"""
|
||||||
@ -266,15 +268,20 @@ class ErrorViewer():
|
|||||||
def get():
|
def get():
|
||||||
return ErrorViewer.errors
|
return ErrorViewer.errors
|
||||||
|
|
||||||
|
|
||||||
class UIError():
|
class UIError():
|
||||||
"""
|
"""
|
||||||
Represents an error to be displayed in the web UI.
|
Represents an error to be displayed in the web UI.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
try:self.title = sys.exc_info()[1].message
|
try:
|
||||||
except:self.title = None
|
self.title = sys.exc_info()[1].message
|
||||||
|
except:
|
||||||
|
self.title = None
|
||||||
self.message = message
|
self.message = message
|
||||||
self.time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
self.time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
try:self.exc_info = sys.exc_info()
|
try:
|
||||||
except:self.exc_info = None
|
self.exc_info = sys.exc_info()
|
||||||
|
except:
|
||||||
|
self.exc_info = None
|
||||||
|
@ -198,7 +198,7 @@ class GenericClient(object):
|
|||||||
logger.log(self.name + u': Unable to set priority for Torrent', logger.ERROR)
|
logger.log(self.name + u': Unable to set priority for Torrent', logger.ERROR)
|
||||||
|
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.log(self.name + u': Failed Sending Torrent: ' + result.name + ' - ' + result.hash, logger.ERROR)
|
logger.log(self.name + u': Failed Sending Torrent: ' + str(result.name) + ' - ' + str(result.hash), logger.ERROR)
|
||||||
logger.log(self.name + u': Exception raised when sending torrent: ' + ex(e), logger.DEBUG)
|
logger.log(self.name + u': Exception raised when sending torrent: ' + ex(e), logger.DEBUG)
|
||||||
return r_code
|
return r_code
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user