Commit ad5f6d81 authored by echel0n's avatar echel0n

Added a list of exceptions to ignore for Sentry.

parent 10e170e9
......@@ -97,6 +97,12 @@ class Logger(logging.getLoggerClass()):
sentry_client = raven.Client('https://[email protected]/2?verify_ssl=0',
release=sickrage.version(), repos={'sickrage': {'name': 'sickrage/sickrage'}})
sentry_ignore_exceptions = [
'KeyboardInterrupt',
'PermissionError',
'FileNotFoundError',
]
sentry_tags = {
'platform': platform.platform(),
'locale': sys.getdefaultencoding(),
......@@ -108,7 +114,7 @@ class Logger(logging.getLoggerClass()):
if sickrage.app.config and sickrage.app.config.app_id:
sentry_tags.update({'app_id': sickrage.app.config.app_id})
sentry_handler = SentryHandler(client=sentry_client, tags=sentry_tags)
sentry_handler = SentryHandler(client=sentry_client, ignore_exceptions=sentry_ignore_exceptions, tags=sentry_tags)
sentry_handler.setLevel(self.logLevels['ERROR'])
sentry_handler.set_name('sentry')
......
......@@ -285,9 +285,8 @@ class TVEpisode(MainDBBase):
rawAirdate = [int(x) for x in str(firstaired).split("-")]
self.airdate = datetime.date(rawAirdate[0], rawAirdate[1], rawAirdate[2])
except (ValueError, IndexError, TypeError):
sickrage.app.log.warning(
"Malformed air date of {} retrieved from {} for ({} - S{:02d}E{:02d})".format(
firstaired, indexer_name, self.show.name, season or 0, episode or 0))
sickrage.app.log.warning("Malformed air date of {} retrieved from {} for ({} - S{:02d}E{:02d})".format(
firstaired, indexer_name, self.show.name, season or 0, episode or 0))
# if I'm incomplete on the indexer but I once was complete then just delete myself from the DB for now
object_session(self).rollback()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment