1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 04:32:51 +01:00
gallery-dl/gallery_dl/exception.py
Mike Fährmann ebe9b0a04c
another attempt at downloader retry behavior
This commit changes the general behavior from
'Retry on every exception and abort on DownloadError' to
'Only retry on DownloadRetry exceptions and abort on every other one'

The previous version would have retried on several states which
would have no chance of ever succeeding (invalid URLs, etc.)
2017-12-07 15:31:14 +01:00

75 lines
1.7 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2015-2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
"""Exception classes used by gallery-dl
Class Hierarchy:
Exception
+-- GalleryDLException
+-- ExtractionError
| +-- AuthenticationError
| +-- AuthorizationError
| +-- NotFoundError
| +-- HttpError
+-- DownloadError
+-- DownloadComplete
+-- NoExtractorError
+-- FormatError
+-- FilterError
+-- StopExtraction
"""
class GalleryDLException(Exception):
"""Base class for GalleryDL exceptions"""
class ExtractionError(GalleryDLException):
"""Base class for exceptions during information extraction"""
class AuthenticationError(ExtractionError):
"""Invalid or missing login information"""
class AuthorizationError(ExtractionError):
"""Insufficient privileges to access a resource"""
class NotFoundError(ExtractionError):
"""Requested resource (gallery/image) does not exist"""
class HttpError(ExtractionError):
"""HTTP request during extraction failed"""
class DownloadRetry(GalleryDLException):
"""Download attempt failed and should be retried"""
class DownloadComplete(GalleryDLException):
"""Output file of attempted download is already complete"""
class NoExtractorError(GalleryDLException):
"""No extractor can handle the given URL"""
class FormatError(GalleryDLException):
"""Error while building output path"""
class FilterError(GalleryDLException):
"""Error while evaluating a filter expression"""
class StopExtraction(GalleryDLException):
"""Extraction should stop"""