Catch urlerrors. closes #1154
This commit is contained in:
@@ -241,9 +241,11 @@ class Plugin(object):
|
||||
self.setCache(cache_key, data, timeout = cache_timeout)
|
||||
return data
|
||||
except:
|
||||
if not kwargs.get('show_error'):
|
||||
if not kwargs.get('show_error', True):
|
||||
raise
|
||||
|
||||
return ''
|
||||
|
||||
def setCache(self, cache_key, value, timeout = 300):
|
||||
log.debug('Setting cache %s', cache_key)
|
||||
Env.get('cache').set(cache_key, value, timeout)
|
||||
|
||||
@@ -3,6 +3,7 @@ from couchpotato.core.helpers.encoding import simplifyString, toUnicode
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.providers.movie.base import MovieProvider
|
||||
from libs.themoviedb import tmdb
|
||||
import traceback
|
||||
|
||||
log = CPLog(__name__)
|
||||
|
||||
@@ -61,7 +62,12 @@ class TheMovieDb(MovieProvider):
|
||||
|
||||
if not results:
|
||||
log.debug('Searching for movie: %s', q)
|
||||
raw = tmdb.search(search_string)
|
||||
|
||||
raw = None
|
||||
try:
|
||||
raw = tmdb.search(search_string)
|
||||
except:
|
||||
log.error('Failed searching TMDB for "%s": %s', (search_string, traceback.format_exc()))
|
||||
|
||||
results = []
|
||||
if raw:
|
||||
|
||||
Reference in New Issue
Block a user