mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -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
|
||||
self.version = -1
|
||||
|
||||
# hash
|
||||
self.hash = ""
|
||||
|
||||
# content
|
||||
self.content = ""
|
||||
|
||||
def __str__(self):
|
||||
|
||||
if self.provider is None:
|
||||
@ -148,10 +154,6 @@ class TorrentSearchResult(SearchResult):
|
||||
"""
|
||||
resultType = "torrent"
|
||||
|
||||
# torrent hash
|
||||
content = None
|
||||
hash = None
|
||||
|
||||
|
||||
class AllShowsListUI:
|
||||
"""
|
||||
@ -266,15 +268,20 @@ class ErrorViewer():
|
||||
def get():
|
||||
return ErrorViewer.errors
|
||||
|
||||
|
||||
class UIError():
|
||||
"""
|
||||
Represents an error to be displayed in the web UI.
|
||||
"""
|
||||
|
||||
def __init__(self, message):
|
||||
try:self.title = sys.exc_info()[1].message
|
||||
except:self.title = None
|
||||
try:
|
||||
self.title = sys.exc_info()[1].message
|
||||
except:
|
||||
self.title = None
|
||||
self.message = message
|
||||
self.time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
try:self.exc_info = sys.exc_info()
|
||||
except:self.exc_info = None
|
||||
try:
|
||||
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)
|
||||
|
||||
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)
|
||||
return r_code
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user