Share via


FaultConverter.TryCreateException Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Wraps OnTryCreateException with error checking.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Syntax

'Declaration
Public Function TryCreateException ( _
    message As Message, _
    fault As MessageFault, _
    <OutAttribute> ByRef exception As Exception _
) As Boolean
public bool TryCreateException(
    Message message,
    MessageFault fault,
    out Exception exception
)

Parameters

  • exception
    Type: System.Exception%
    If conversion is successful, the SOAP exception, returned as an out parameter.

Return Value

Type: System.Boolean
true if fault was successfully converted; otherwise, false. The default is false.

Exceptions

Exception Condition
ArgumentNullException

message or fault is nulla null reference (Nothing in Visual Basic).

ArgumentNullException

OnTryCreateException returned true, but exception is nulla null reference (Nothing in Visual Basic).

ArgumentNullException

OnTryCreateException returned false, but exception is not nulla null reference (Nothing in Visual Basic).

Remarks

OnTryCreateException is an abstract method that you must implement. The current method wraps several parameter error tests around a call to that method.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.