Skip to content

Signalr .net core central exception handling #16880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sumanrajpura opened this issue Feb 6, 2020 · 3 comments
Closed

Signalr .net core central exception handling #16880

sumanrajpura opened this issue Feb 6, 2020 · 3 comments
Labels
SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@sumanrajpura
Copy link

I want to handle exception from any method of Hub onto one single location as we can do that via app.UseExceptionHandler in webapi. Is there any way to do this in signalr .net core?
I tried with GlobalHost.HubPipeline.AddModule(new ErrorHandlingPipelineModule()); but via this also exception is not getting handled.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added ⌚ Not Triaged SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue labels Feb 6, 2020
Copy link

Same question

@BrennanConroy
Copy link
Member

There is no way to do this today outside of putting try catch inside all your hub methods.

This support will be added as part of dotnet/aspnetcore#5353

@BrennanConroy
Copy link
Member

Hub filters are in 5.0, you can add an exception handler filter. More details on hub filters in the docs: https://docs.microsoft.com/aspnet/core/signalr/hub-filters?view=aspnetcore-5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SignalR Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

5 participants