Debian Codegraph @

cloudscraper/exceptions.py

raw
1 # -*- coding: utf-8 -*-
2
3 # ------------------------------------------------------------------------------- #
4
5 """
6 cloudscraper.exceptions
7 ~~~~~~~~~~~~~~~~~~~
8 This module contains the set of cloudscraper exceptions.
9 """
10
11 # ------------------------------------------------------------------------------- #
12
13
14 class CloudflareException(Exception):
15 """
16 Base exception class for cloudscraper for Cloudflare
17 """
18
19
20 class CloudflareLoopProtection(CloudflareException):
21 """
22 Raise an exception for recursive depth protection
23 """
24
25
26 class CloudflareCode1020(CloudflareException):
27 """
28 Raise an exception for Cloudflare code 1020 block
29 """
30
31
32 class CloudflareIUAMError(CloudflareException):
33 """
34 Raise an error for problem extracting IUAM paramters
35 from Cloudflare payload
36 """
37
38
39 class CloudflareChallengeError(CloudflareException):
40 """
41 Raise an error when detected new Cloudflare challenge
42 """
43
44
45 class CloudflareSolveError(CloudflareException):
46 """
47 Raise an error when issue with solving Cloudflare challenge
48 """
49
50
51 class CloudflareCaptchaError(CloudflareException):
52 """
53 Raise an error for problem extracting Captcha paramters
54 from Cloudflare payload
55 """
56
57
58 class CloudflareCaptchaProvider(CloudflareException):
59 """
60 Raise an exception for no Captcha provider loaded for Cloudflare.
61 """
62
63 # ------------------------------------------------------------------------------- #
64
65
66 class CaptchaException(Exception):
67 """
68 Base exception class for cloudscraper captcha Providers
69 """
70
71
72 class CaptchaServiceUnavailable(CaptchaException):
73 """
74 Raise an exception for external services that cannot be reached
75 """
76
77
78 class CaptchaAPIError(CaptchaException):
79 """
80 Raise an error for error from API response.
81 """
82
83
84 class CaptchaAccountError(CaptchaException):
85 """
86 Raise an error for captcha provider account problem.
87 """
88
89
90 class CaptchaTimeout(CaptchaException):
91 """
92 Raise an exception for captcha provider taking too long.
93 """
94
95
96 class CaptchaParameter(CaptchaException):
97 """
98 Raise an exception for bad or missing Parameter.
99 """
100
101
102 class CaptchaBadJobID(CaptchaException):
103 """
104 Raise an exception for invalid job id.
105 """
106
107
108 class CaptchaReportError(CaptchaException):
109 """
110 Raise an error for captcha provider unable to report bad solve.
111 """