-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.py
More file actions
43 lines (31 loc) · 1017 Bytes
/
errors.py
File metadata and controls
43 lines (31 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Error(Exception):
"""Base class for exceptions in this module."""
pass
class RobotError(Error):
"""Exception raised for robot detection (solvable).
Attributes:
message -- explanation of the error
"""
def __init__(self):
self.message = "Robot Check Detected."
class AQError(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = "Automated Queries Check Detected."
class SearchError(Error):
"""Exception raised for empty search results.
Attributes:
message -- explanation of the error.
"""
def __init__(self):
self.message = "No search results."
class GScholarError(Error):
"""Exception raised for auto-query detection.
Attributes:
message -- explanation of the error (non-solvable).
"""
def __init__(self):
self.message = "No more alternative addresses. Restart this program."