2023-01-12 01:04:47 +00:00
|
|
|
#
|
|
|
|
# This file is part of SickGear.
|
|
|
|
#
|
|
|
|
# SickGear 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.
|
|
|
|
#
|
|
|
|
# SickGear 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 SickGear. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
# noinspection PyUnreachableCode
|
|
|
|
if False:
|
|
|
|
from typing import AnyStr
|
|
|
|
|
|
|
|
|
|
|
|
def ex(e):
|
|
|
|
# type: (BaseException) -> AnyStr
|
|
|
|
"""Returns a unicode string from the exception text if it exists"""
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
return str(e)
|
2023-01-12 01:04:47 +00:00
|
|
|
|
|
|
|
|
2023-02-13 21:00:11 +00:00
|
|
|
# noinspection DuplicatedCode
|
2023-02-10 14:15:50 +00:00
|
|
|
class SickGearException(Exception):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Generic SickGear Exception - should never be thrown, only subclassed"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class ConfigErrorException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Error in the config file"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class LaterException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Something bad happened that I'll make a real exception for later"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class NoNFOException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""No NFO was found!"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class NoShowDirException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Unable to find the show's directory"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class FileNotFoundException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The specified file doesn't exist"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class MultipleDBEpisodesException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Found multiple episodes in the DB! Must fix DB first"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class MultipleDBShowsException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Found multiple shows in the DB! Must fix DB first"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class MultipleShowObjectsException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Found multiple objects for the same show! Something is very wrong"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class WrongShowException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The episode doesn't belong to the same show as its parent folder"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class ShowNotFoundException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show wasn't found on the Indexer"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class EpisodeNotFoundException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The episode wasn't found on the Indexer"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class ShowDirNotFoundException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show dir doesn't exist"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class AuthException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Your authentication information is incorrect"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class EpisodeDeletedException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""This episode has been deleted"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class CantRefreshException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show can't be refreshed right now"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class CantUpdateException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show can't be updated right now"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class CantSwitchException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show can't be switched right now"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class PostProcessingFailed(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Post-processing the episode failed"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class FailedProcessingFailed(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Post-processing the failed release failed"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class FailedHistoryMultiSnatchException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Episode was snatched again before the first one was done"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class FailedHistoryNotFoundException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The release was not found in the failed download history tracker"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class EpisodeNotFoundByAbsoluteNumberException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""The show wasn't found in the DB while looking at Absolute Numbers"""
|
|
|
|
|
|
|
|
|
2023-02-10 14:15:50 +00:00
|
|
|
class ConnectionSkipException(SickGearException):
|
2023-01-12 01:04:47 +00:00
|
|
|
"""Connection was skipped because of previous errors"""
|