Class FaultDescription
Contains fault and error information intended for WCF/SOAP communication.
Inherited Members
Namespace: SdlSdl.LanguagePlatformCore
Assembly: Sdl.LanguagePlatform.Core.dll
Syntax
[DataContract]
public class FaultDescription
Constructors
FaultDescription(ErrorCode)
Instantiates a new object and initializes it with the specified error code. The error message is retrieved from the resources, and the error status is set to Error.
Declaration
public FaultDescription(ErrorCode code)
Parameters
Type | Name | Description |
---|---|---|
ErrorCode | code | The error code |
FaultDescription(ErrorCode, FaultStatus)
Instantiates a new object and initializes it with the specified error code, error status, and empty error data. The error message is retrieved from the resources.
Declaration
public FaultDescription(ErrorCode code, FaultStatus status)
Parameters
Type | Name | Description |
---|---|---|
ErrorCode | code | The error code |
FaultStatus | status | The error status |
FaultDescription(ErrorCode, FaultStatus, string)
Initializes the object with the specified error code, error status, and additional error data. The error message is retrieved from the resources.
Declaration
public FaultDescription(ErrorCode code, FaultStatus status, string data)
Parameters
Type | Name | Description |
---|---|---|
ErrorCode | code | The error code |
FaultStatus | status | The error status |
string | data | Additional error data, may be null |
FaultDescription(ErrorCode, string)
Instantiates a new object and initializes it with the specified error code and data. The error message is retrieved from the resources, and the error status is set to Error.
Declaration
public FaultDescription(ErrorCode code, string data)
Parameters
Type | Name | Description |
---|---|---|
ErrorCode | code | The error code |
string | data | Additional error data, may be null |
FaultDescription(Exception)
Initializes a new instance of the FaultDescription class from a system exception.
Declaration
public FaultDescription(Exception e)
Parameters
Type | Name | Description |
---|---|---|
Exception | e | The system exception. |
Properties
Data
Gets any additional data relevant for the fault.
Declaration
[DataMember]
public string Data { get; set; }
Property Value
Type | Description |
---|---|
string |
ErrorCode
Gets the error code associated with the fault.
Declaration
[DataMember]
public ErrorCode ErrorCode { get; set; }
Property Value
Type | Description |
---|---|
ErrorCode |
Message
Gets the error message.
Declaration
[DataMember]
public string Message { get; set; }
Property Value
Type | Description |
---|---|
string |
Status
Gets the fault status.
Declaration
[DataMember]
public FaultStatus Status { get; set; }
Property Value
Type | Description |
---|---|
FaultStatus |
Methods
GetDescriptionFromErrorCode(ErrorCode)
Retrieves a localized error message (which may include Format(string, object) placeholders) for the provided error code.
Declaration
public static string GetDescriptionFromErrorCode(ErrorCode code)
Parameters
Type | Name | Description |
---|---|---|
ErrorCode | code | An error code |
Returns
Type | Description |
---|---|
string | A possibly localized error message (depending on the current thread's culture). |