TryCreateException Method
Collapse the table of content
Expand the table of content

FaultConverter.TryCreateException Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Wraps OnTryCreateException with error checking.

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

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

Parameters

message
Type: System.ServiceModel.Channels.Message
The fault message.
fault
Type: System.ServiceModel.Channels.MessageFault
The fault.
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.

ExceptionCondition
ArgumentNullException

message or fault is Nothing.

ArgumentNullException

OnTryCreateException returned true, but exception is Nothing.

ArgumentNullException

OnTryCreateException returned false, but exception is not Nothing.

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft