Commit 20c7871
authored
Use
Resolves #325.
When turning the device's wifi off, the following was observed with
URLSession:
Before:
```
▿ Optional<ConnectError>
▿ some : ConnectError
- code : Connect.Code.unknown
▿ message : Optional<String>
- some : "The Internet connection appears to be offline."
▿ exception : Optional<Error>
- some : Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
```
Based on the discussion in the issue linked above, this PR updates the
code to be `.unavailable`:
```
▿ Optional<ConnectError>
▿ some : ConnectError
- code : Connect.Code.unavailable
▿ message : Optional<String>
- some : "The Internet connection appears to be offline."
▿ exception : Optional<Error>
- some : Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
```
The NIO client has also been updated to return the `.unavailable` status
code:
```
▿ Optional<ConnectError>
▿ some : ConnectError
- code : Connect.Code.unavailable
▿ message : Optional<String>
- some : "client is not connected"
- exception : nil
```
---------
Signed-off-by: Michael Rebello <me@michaelrebello.com>ConnectError.unavailable when client is offline (#328)1 parent 0820008 commit 20c7871
2 files changed
Lines changed: 18 additions & 8 deletions
File tree
- Libraries
- ConnectNIO/Public
- Connect/Public/Implementation/Clients
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
| |||
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
140 | | - | |
| 136 | + | |
141 | 137 | | |
142 | 138 | | |
143 | 139 | | |
144 | | - | |
| 140 | + | |
145 | 141 | | |
146 | 142 | | |
147 | 143 | | |
| |||
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
168 | | - | |
| 164 | + | |
169 | 165 | | |
170 | 166 | | |
171 | 167 | | |
| |||
268 | 264 | | |
269 | 265 | | |
270 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
0 commit comments