Click or drag to resize
LocationException Class
Indicates a Failure in the API's processing of a request, caused by problems with the Location that the request specified.
Inheritance Hierarchy

Namespace: DegreeDays.Api.Data
Assembly: DegreeDaysApi (in DegreeDaysApi.dll) Version: 1.1.0.0 (1.1.0.0)
Syntax
public sealed class LocationException : RequestFailureException

The LocationException type exposes the following members.

Properties
  NameDescription
Public propertyFailure
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.)
Public propertyIsDueToLocationNotRecognized
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.
Public propertyIsDueToLocationNotSupported
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.
Public propertyMessage
Overridden to return the Failure details as the exception message.
(Inherited from FailureException.)
Public propertyResponseMetadata
Gets the non-null metadata from the FailureResponse that brought details of this failure back from the API servers.
(Inherited from RequestFailureException.)
Top
Remarks

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.

See Also