HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Class ApiExceptionHubFilter

    Hub filter that reports exceptions thrown by hub methods (including during enumeration of streamed results) and connection handlers to clients as API errors. Exceptions are mapped using the registered IApiExceptionHandler (if any), so hub exceptions are logged and reported consistently with regular and streaming API responses, and the resulting ApiException is sent to the client in a form that the API client reconstructs as the same exception type.

    Inheritance
    object
    ApiExceptionHubFilter
    Implements
    IHubFilter
    Namespace: Singulink.Net.Http.Api.Service
    Assembly: Singulink.Net.Http.Api.Service.dll
    Syntax
    public sealed class ApiExceptionHubFilter : IHubFilter
    Remarks

    Register the filter via AddApiExceptionFilter(HubOptions). Exceptions that are not mapped to an ApiException (i.e. unexpected exceptions with no handler registered) propagate to SignalR's default handling. Streamed results are only wrapped for hub methods that return IAsyncEnumerable<T> (directly or via a task); exceptions from channel-based streams are not translated.

    Methods

    Name Description
    InvokeMethodAsync(HubInvocationContext, Func<HubInvocationContext, ValueTask<object?>>)

    Allows handling of all Hub method invocations.

    OnConnectedAsync(HubLifetimeContext, Func<HubLifetimeContext, Task>)

    Allows handling of the OnConnectedAsync() method.

    OnDisconnectedAsync(HubLifetimeContext, Exception?, Func<HubLifetimeContext, Exception?, Task>)

    Allows handling of the OnDisconnectedAsync(Exception) method.

    © Singulink. All rights reserved.