gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.app / org.gvsig.scripting.app.mainplugin / src / main / resources-plugin / scripting / lib / geopy / exc.py @ 545
History | View | Annotate | Download (2.4 KB)
1 |
"""
|
---|---|
2 |
Exceptions raised by geopy.
|
3 |
"""
|
4 |
|
5 |
class GeopyError(Exception): |
6 |
"""
|
7 |
Geopy-specific exceptions are all inherited from GeopyError.
|
8 |
"""
|
9 |
|
10 |
class ConfigurationError(GeopyError): |
11 |
"""
|
12 |
When instantiating a geocoder, the arguments given were invalid. See
|
13 |
the documentation of each geocoder's `__init__` for more details.
|
14 |
"""
|
15 |
|
16 |
class GeocoderServiceError(GeopyError): |
17 |
"""
|
18 |
There was an exception caused when calling the remote geocoding service,
|
19 |
and no more specific exception could be raised by geopy. When calling
|
20 |
geocoders' `geocode` or `reverse` methods, this is the most general
|
21 |
exception that can be raised, and any non-geopy exception will be caught
|
22 |
and turned into this. The exception's message will be that of the
|
23 |
original exception.
|
24 |
"""
|
25 |
|
26 |
class GeocoderQueryError(GeocoderServiceError): |
27 |
"""
|
28 |
Either geopy detected input that would cause a request to fail,
|
29 |
or a request was made and the remote geocoding service responded
|
30 |
that the request was bad.
|
31 |
"""
|
32 |
|
33 |
class GeocoderQuotaExceeded(GeocoderServiceError): |
34 |
"""
|
35 |
The remote geocoding service refused to fulfill the request
|
36 |
because the client has used its quota.
|
37 |
"""
|
38 |
|
39 |
class GeocoderAuthenticationFailure(GeocoderServiceError): |
40 |
"""
|
41 |
The remote geocoding service rejects the API key or account
|
42 |
credentials this geocoder was instantiated with.
|
43 |
"""
|
44 |
|
45 |
class GeocoderInsufficientPrivileges(GeocoderServiceError): |
46 |
"""
|
47 |
The remote geocoding service refused to fulfill a request using the
|
48 |
account credentials given.
|
49 |
"""
|
50 |
|
51 |
class GeocoderTimedOut(GeocoderServiceError): |
52 |
"""
|
53 |
The call to the geocoding service was aborted because no response
|
54 |
was receiving within the `timeout` argument of either the geocoding class
|
55 |
or, if specified, the method call. Some services are just consistently
|
56 |
slow, and a higher timeout may be needed to use them.
|
57 |
"""
|
58 |
|
59 |
class GeocoderUnavailable(GeocoderServiceError): |
60 |
"""
|
61 |
Either it was not possible to establish a connection to the remote
|
62 |
geocoding service, or the service responded with a code indicating
|
63 |
it was unavailable.
|
64 |
"""
|
65 |
|
66 |
class GeocoderParseError(GeocoderServiceError): |
67 |
"""
|
68 |
Geopy could not parse the service's response. This is a bug in geopy.
|
69 |
"""
|
70 |
|
71 |
class GeocoderNotFound(GeopyError): |
72 |
"""
|
73 |
Caller requested the geocoder matching a string, e.g.,
|
74 |
"google" > GoogleV3, but no geocoder could be found.
|
75 |
"""
|