dotnet / dotnet/AspNetCore.Docs

Specific exception type to indicate start failures?

Open
#16,834 0 comments 0 reactions 0 assignees View on GitHub
SignalR Source - Docs.ms support-request
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

The sample code for handling start failures employs a `catch`-all block. Is it safe to assume that any exception thrown by `StartAsync` indicates that retrying the start operation is appropriate?

I'd feel more comfortable catching a specific exception type that's documented as indicating that a retry is appropriate. I understand that, internally, a variety of exception types may be thrown. But perhaps `StartAsync` should catch those exceptions and wrap them in a single exception type before rethrowing them.

---
#### Document Details

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

* ID: c9bc1072-be2c-94f6-49bf-daa9e97dff2d
* Version Independent ID: 36052173-7061-6d01-8aed-915685cd7cf6
* Content: [ASP.NET Core SignalR .NET Client](https://docs.microsoft.com/en-us/aspnet/core/signalr/dotnet-client?view=aspnetcore-3.1&tabs=visual-studio#call-hub-methods-from-client)
* Content Source: [aspnetcore/signalr/dotnet-client.md](https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/signalr/dotnet-client.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-signalr**
* GitHub Login: @bradygaster
* Microsoft Alias: **bradyg**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.