1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00
SickRage/sickbeard/exceptions.py
echel0n 0d9fbc1ad7 Welcome to our SickBeard-TVRage Edition ...
This version of SickBeard uses both TVDB and TVRage to search and gather it's series data from allowing you to now have access to and download shows that you couldn't before because of being locked into only what TheTVDB had to offer.

Also this edition is based off the code we used in our XEM editon so it does come with scene numbering support as well as all the other features our XEM edition has to offer.

Please before using this with your existing database (sickbeard.db) please make a backup copy of it and delete any other database files such as cache.db and failed.db if present, we HIGHLY recommend starting out with no database files at all to make this a fresh start but the choice is at your own risk!

Enjoy!
2014-03-09 22:39:12 -07:00

109 lines
3.4 KiB
Python

# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Sick Beard is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Sick Beard. If not, see <http://www.gnu.org/licenses/>.
from sickbeard.encodingKludge import fixStupidEncodings
def ex(e):
"""
Returns a unicode string from the exception text if it exists.
"""
# sanity check
if not e.args or not e.args[0]:
return ""
e_message = fixStupidEncodings(e.args[0], True)
# if fixStupidEncodings doesn't fix it then maybe it's not a string, in which case we'll try printing it anyway
if not e_message:
try:
e_message = str(e.args[0])
except:
e_message = ""
return e_message
class SickBeardException(Exception):
"Generic SickBeard Exception - should never be thrown, only subclassed"
class ConfigErrorException(SickBeardException):
"Error in the config file"
class LaterException(SickBeardException):
"Something bad happened that I'll make a real exception for later"
class NoNFOException(SickBeardException):
"No NFO was found!"
class NoShowDirException(SickBeardException):
"Unable to find the show's directory"
class FileNotFoundException(SickBeardException):
"The specified file doesn't exist"
class MultipleDBEpisodesException(SickBeardException):
"Found multiple episodes in the DB! Must fix DB first"
class MultipleDBShowsException(SickBeardException):
"Found multiple shows in the DB! Must fix DB first"
class MultipleShowObjectsException(SickBeardException):
"Found multiple objects for the same show! Something is very wrong"
class WrongShowException(SickBeardException):
"The episode doesn't belong to the same show as its parent folder"
class ShowNotFoundException(SickBeardException):
"The show wasn't found in the indexer's listings"
class EpisodeNotFoundException(SickBeardException):
"The episode wasn't found in the indexer's listings"
class NewzbinAPIThrottled(SickBeardException):
"Newzbin has throttled us, deal with it"
class TVRageException(SickBeardException):
"TVRage API did something bad"
class ShowDirNotFoundException(SickBeardException):
"The show dir doesn't exist"
class AuthException(SickBeardException):
"Your authentication information is incorrect"
class EpisodeDeletedException(SickBeardException):
"This episode has been deleted"
class CantRefreshException(SickBeardException):
"The show can't be refreshed right now"
class CantUpdateException(SickBeardException):
"The show can't be updated right now"
class PostProcessingFailed(SickBeardException):
"Post-processing the episode failed"
class FailedProcessingFailed(SickBeardException):
"Post-processing the failed release failed"
class FailedHistoryMultiSnatchException(SickBeardException):
"Episode was snatched again before the first one was done"
class FailedHistoryNotFoundException(SickBeardException):
"The release was not found in the failed download history tracker"