Commit 94b45b5
committed
Improve error handling and add new test case
Enhanced error handling in TlsClient.Core with a try-catch block and default response creation for exceptions. Refined response handling in TlsClient.HttpClient by replacing status checks with `IsSuccessStatus` and adding null/empty validations.
Added a new test case `ShouldErrorWithCatch` in TlsClient.Issues to validate error handling for 500 Internal Server Error responses. Updated base URL and request path in Issue4.cs to use `https://httpbin.org` and simulate error scenarios.
General improvements include additional null/empty checks and increased test coverage.1 parent 862273f commit 94b45b5
File tree
3 files changed
+51
-10
lines changed- src
- TlsClient.Core
- TlsClient.HttpClient
- tests/TlsClient.Issues
3 files changed
+51
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
13 | 36 | | |
14 | 37 | | |
15 | 38 | | |
| |||
34 | 57 | | |
35 | 58 | | |
36 | 59 | | |
37 | | - | |
| 60 | + | |
38 | 61 | | |
39 | 62 | | |
40 | 63 | | |
41 | 64 | | |
42 | 65 | | |
43 | | - | |
| 66 | + | |
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
| |||
0 commit comments