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

Namespace: DegreeDays.Api
Assembly: DegreeDaysApi (in DegreeDaysApi.dll) Version: 1.1.0.0 (1.1.0.0)
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 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 framework. For example, there's an "InvalidRequestXml" code that you should never receive unless you have modified the mechanism that this .NET client framework 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