Editare

Partajați prin


ExceptionHandler.HandleException(Exception) Method

Definition

When overridden in a derived class, returns true if the exception has been handled, or false if the exception should be rethrown and the application terminated.

public:
 abstract bool HandleException(Exception ^ exception);
public abstract bool HandleException (Exception exception);
abstract member HandleException : Exception -> bool
Public MustOverride Function HandleException (exception As Exception) As Boolean

Parameters

exception
Exception

The exception the occurred within the Windows Communication Foundation (WCF) runtime and which may terminate the application.

Returns

true if the exception has been handled; otherwise, false.

Examples

The following code example shows an implementation of the ExceptionHandler abstract class that overrides the HandleException method.

The following code example shows how to enable the custom MyExceptionHandler for unhandled exceptions that occur within the WCF runtime.

Remarks

The HandleException property returns true if the exception has been handled. If it returns false or throws a different exception, the original exception is rethrown.

Applies to