Location |
The LocationException type exposes the following members.
Name | Description | |
---|---|---|
Failure |
Gets the non-null Failure object containing details of
the failure on the API's servers that led to this exception on the
client.
(Inherited from FailureException) | |
IsDueToLocationNotRecognized | Returns true if this failure came in response to a request for data from a location that the API did not recognize as a weather station or real-world geographic location. | |
IsDueToLocationNotSupported | Returns true if this failure came in response to a request for data from a location that is recognized but not currently supported by the API. | |
Message |
Overridden to return the Failure details as the exception
message.
(Inherited from FailureException) | |
ResponseMetadata |
Gets the non-null metadata from the
FailureResponse that brought details of this failure back
from the API servers.
(Inherited from RequestFailureException) |
This exception corresponds to any failure code starting with "Location".
You can interrogate the IsDueToLocationXXX properties of this exception to find out more about the cause. But do note that it is possible for none of those properties to hold true if a relevant new failure code is added into the API. Be prepared for this in your handling.
You might not need to pay any attention to the specific code behind the LocationException. For many use-cases, the best way to handle a LocationException is just to try again with an alternative location. For example, if a request for data from a specific station ID fails, you might want to try a request for the GeographicLocation of the real-world building you ultimately want data for, so that the API can find a replacement station for you automatically.