improve 'extractor.request'
- add 'fatal' argument - improve internal logic and flow - raise known exception on error - update exception hierarchy
This commit is contained in:
@@ -6,22 +6,49 @@
|
||||
# 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 NoExtractorError(Exception):
|
||||
"""No extractor can handle the given URL"""
|
||||
Class Hierarchy:
|
||||
|
||||
Exception
|
||||
+-- GalleryDLException
|
||||
+-- ExtractionError
|
||||
| +-- AuthenticationError
|
||||
| +-- AuthorizationError
|
||||
| +-- NotFoundError
|
||||
| +-- HttpError
|
||||
+-- NoExtractorError
|
||||
+-- StopExtraction
|
||||
"""
|
||||
|
||||
|
||||
class AuthenticationError(Exception):
|
||||
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(Exception):
|
||||
class AuthorizationError(ExtractionError):
|
||||
"""Insufficient privileges to access a resource"""
|
||||
|
||||
|
||||
class NotFoundError(Exception):
|
||||
class NotFoundError(ExtractionError):
|
||||
"""Requested resource (gallery/image) does not exist"""
|
||||
|
||||
|
||||
class StopExtraction(Exception):
|
||||
class HttpError(ExtractionError):
|
||||
"""HTTP request during extraction failed"""
|
||||
|
||||
|
||||
class NoExtractorError(GalleryDLException):
|
||||
"""No extractor can handle the given URL"""
|
||||
|
||||
|
||||
class StopExtraction(GalleryDLException):
|
||||
"""Extraction should stop"""
|
||||
|
||||
Reference in New Issue
Block a user