forked from mvexel/overpass-api-python-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.py
45 lines (28 loc) · 1.12 KB
/
errors.py
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
44
45
class OverpassError(Exception):
"""An error during your request occurred.
Super class for all Overpass api errors."""
pass
class OverpassSyntaxError(OverpassError, ValueError):
"""The request contains a syntax error."""
def __init__(self, request):
self.request = request
class TimeoutError(OverpassError):
"""A request timeout occurred."""
def __init__(self, timeout):
self.timeout = timeout
class MultipleRequestsError(OverpassError):
"""You are trying to run multiple requests at the same time."""
pass
class ServerLoadError(OverpassError):
"""The Overpass server is currently under load and declined the request.
Try again later or retry with reduced timeout value."""
def __init__(self, timeout):
self.timeout = timeout
class UnknownOverpassError(OverpassError):
"""An unknown kind of error happened during the request."""
def __init__(self, message):
self.message = message
class ServerRuntimeError(OverpassError):
"""The Overpass server returned a runtime error"""
def __init__(self, message):
self.message = message