1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 11:12:40 +01:00
gallery-dl/gallery_dl/exception.py

80 lines
1.9 KiB
Python
Raw Normal View History

2015-12-12 00:11:05 +01:00
# -*- coding: utf-8 -*-
2018-09-05 18:15:33 +02:00
# Copyright 2015-2018 Mike Fährmann
2015-12-12 00:11:05 +01:00
#
# 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
2017-01-30 19:40:15 +01:00
Class Hierarchy:
Exception
+-- GalleryDLException
+-- ExtractionError
| +-- AuthenticationError
| +-- AuthorizationError
| +-- NotFoundError
| +-- HttpError
+-- DownloadError
2018-09-05 18:15:33 +02:00
| +-- DownloadComplete
| +-- DownloadRetry
+-- NoExtractorError
+-- FormatError
+-- FilterError
+-- StopExtraction
"""
class GalleryDLException(Exception):
"""Base class for GalleryDL exceptions"""
class ExtractionError(GalleryDLException):
"""Base class for exceptions during information extraction"""
2016-07-14 14:57:42 +02:00
2017-01-30 19:40:15 +01:00
class AuthenticationError(ExtractionError):
2016-08-27 17:39:45 +02:00
"""Invalid or missing login information"""
2017-01-30 19:40:15 +01:00
class AuthorizationError(ExtractionError):
"""Insufficient privileges to access a resource"""
2017-01-30 19:40:15 +01:00
class NotFoundError(ExtractionError):
2016-08-27 17:39:45 +02:00
"""Requested resource (gallery/image) does not exist"""
class HttpError(ExtractionError):
"""HTTP request during extraction failed"""
2018-09-05 18:15:33 +02:00
class DownloadError(GalleryDLException):
"""Base class for exceptions during file downloads"""
class DownloadRetry(DownloadError):
"""Download attempt failed and should be retried"""
2018-09-05 18:15:33 +02:00
class DownloadComplete(DownloadError):
"""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"""