Click or drag to resize

Failure Class

Contains details of a failure in the server-side processing of all or part of an API request.
Inheritance Hierarchy
SystemObject
  DegreeDays.ApiFailure

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

The Failure type exposes the following members.

Properties
 NameDescription
Public propertyCode Gets the non-null, non-empty code associated with this failure.
Public propertyMessage Gets the non-null message associated with this failure, providing explanatory information about the Code and what went wrong.
Top
Methods
 NameDescription
Public methodEquals A Failure can only be equal to another Failure with an equal Code and Message.
(Overrides ObjectEquals(Object))
Public methodGetHashCode Overridden to ensure consistency with Equals.
(Overrides ObjectGetHashCode)
Public methodToString Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.
(Overrides ObjectToString)
Top
Remarks

A failure is primarily defined by its Code. But it also comes with a Message to help explain the meaning of the code.

You are unlikely to need to deal with Failure objects or failure codes directly, as API methods like GetLocationData(LocationDataRequest) and GetBase(DataSpec) will automatically turn any failure codes into appropriate subclasses of FailureException.

Thread Safety
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
See Also