Table of Contents

Delegate Container.ChangeFeedMonitorErrorDelegate

Namespace
Microsoft.Azure.Cosmos
Assembly
Microsoft.Azure.Cosmos.Client.dll

Delegate to notify errors during change feed operations.

public delegate Task Container.ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception)

Parameters

leaseToken string

A unique identifier for the lease.

exception Exception

The exception that happened.

Returns

Task

A Task representing the asynchronous operation that is going to be done with the notification.

Extension Methods

Examples

(string leaseToken, Exception exception) =>
{
    if (exception is ChangeFeedProcessorUserException userException)
    {
        Console.WriteLine($"Current instance's delegate had an unhandled when processing lease {leaseToken}.");
        Console.WriteLine($"Diagnostics {userException.ExceptionContext.Diagnostics}");
        Console.WriteLine($"Headers {userException.ExceptionContext.Headers}");
        Console.WriteLine(userException.ToString());
    }
    else 
    {
        Console.WriteLine($"Current instance faced an exception when processing lease {leaseToken}.");
        Console.WriteLine(exception.ToString());
    }

    return Task.CompletedTask;
}

Constructors

ChangeFeedMonitorErrorDelegate(object, nint)

public ChangeFeedMonitorErrorDelegate(object @object, nint method)

Parameters

object object
method nint

Methods

BeginInvoke(string, Exception, AsyncCallback, object)

public virtual IAsyncResult BeginInvoke(string leaseToken, Exception exception, AsyncCallback callback, object @object)

Parameters

leaseToken string
exception Exception
callback AsyncCallback
object object

Returns

IAsyncResult

EndInvoke(IAsyncResult)

public virtual Task EndInvoke(IAsyncResult result)

Parameters

result IAsyncResult

Returns

Task

Invoke(string, Exception)

public virtual Task Invoke(string leaseToken, Exception exception)

Parameters

leaseToken string
exception Exception

Returns

Task