Click or drag to resize

InvalidRequestException Class

Indicates that the API could not process a request because it was invalid in some way (e.g. authenticated with invalid API access keys).
Inheritance Hierarchy
SystemObject
  SystemException
    DegreeDays.ApiDegreeDaysApiException
      DegreeDays.ApiFailureException
        DegreeDays.ApiRequestFailureException
          DegreeDays.ApiInvalidRequestException

Namespace: DegreeDays.Api
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public sealed class InvalidRequestException : RequestFailureException

The InvalidRequestException 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 propertyIsDueToInvalidRequestAccount Returns true if this failure came in response to a request that was sent with an unrecognized account key.
Public propertyIsDueToInvalidRequestForAccountPlan Returns true if this failure came in response to a request for data that is not available on the API account plan associated with the account key.
Public propertyIsDueToInvalidRequestSignature Returns true if this failure came in response to a request that was sent with an invalid signature, typically caused by a problem with the security key.
Public propertyIsDueToInvalidRequestTimestamp Returns true if this failure came in response to a request that was sent with an invalid timestamp, typically caused by an out-of-sync clock on the client machine.
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 "InvalidRequest".

The IsDueToInvalidRequestXXX properties contained within this class make it easy to test for the "InvalidRequestXXX" codes that you are likely to want to test for. There are also several "InvalidRequestXXX" codes that do not have corresponding IsDueToInvalidRequestXXX convenience properties, but these codes should not arise through normal use of this .NET client library. For example, there's an "InvalidRequestXml" code that you should never receive unless you have modified the mechanism that this .NET client library uses to generate the XML requests (something you're unlikely to want to do).

All "InvalidRequestXXX" codes will cause this exception to be thrown, irrespective of whether they have their own IsDueToInvalidRequestXXX properties. If, for some reason, you need to explicitly check for an "InvalidRequestXXX" code that does not have its own IsDueToInvalidRequestXXX property, you can always check for it by testing the failure code string directly.

If you're testing the IsDueToInvalidRequestXXX properties, please do make sure that your code won't blow up if none of them return true.

See Also