Commit 3dc8309
committed
feat(core): promote AuthenticationFailureException + ConnectionAttemptFailedException to public top-level types
Both exceptions used to live as `internal sealed class` definitions nested at
the bottom of ObsWebSocketClient.cs. The library already raises a public
`AuthenticationFailure` event with a public AuthenticationFailureEventArgs, so
the typed signal exists — but consumers that prefer a typed catch over an
event subscription couldn't `catch (AuthenticationFailureException)` because
the type wasn't visible.
Promote both exceptions to public top-level types in their own files,
documented inline. Internal call sites and the existing tests (which already
referenced these by name through InternalsVisibleTo) compile unchanged. The
public AuthenticationFailure event continues to fire for callers that prefer
the event-driven path.
Motivation: downstream consumers (StreamWeaver in particular) used to
string-match exception messages — `Contains("auth")` / `Contains("credential")`
on ObsWebSocketException — which is fragile to library wording changes. With
the typed exception public, those callers can switch to a clean
`catch (AuthenticationFailureException)` or subscribe to the existing
AuthenticationFailure event.1 parent 8bb8862 commit 3dc8309
3 files changed
Lines changed: 67 additions & 7 deletions
File tree
- ObsWebSocket.Core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2549 | 2549 | | |
2550 | 2550 | | |
2551 | 2551 | | |
2552 | | - | |
2553 | | - | |
2554 | | - | |
2555 | | - | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
| 2552 | + | |
| 2553 | + | |
2559 | 2554 | | |
0 commit comments