- Notifications
You must be signed in to change notification settings - Fork906
Commite5c2548
authored
fix(cli): handle nil unwrap errors when formatting (#18099)
Discovered an unhelpful error when running a CLI command without internet (I didn't know I didn't have internet!):```$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: <nil>```The source of this was that calling `Unwrap()` on `net.DNSError` can return nil, causing the whole error trace to get replaced by it. Instead, we'll just treat a nil `Unwrap()` return value as if there was nothing to unwrap.The result is:```$ coder lsEncountered an error running "coder list", see "coder list --help" for more informationerror: query workspaces: Get "https://dev.coder.com/api/v2/workspaces?q=owner%3Ame": dial tcp: lookup dev.coder.com: no such host```1 parent25e2146 commite5c2548
1 file changed
+6
-5
lines changedLines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1060 | 1060 |
| |
1061 | 1061 |
| |
1062 | 1062 |
| |
1063 |
| - | |
1064 |
| - | |
1065 |
| - | |
1066 |
| - | |
1067 |
| - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1068 | 1069 |
| |
1069 | 1070 |
| |
1070 | 1071 |
| |
|
0 commit comments
Comments
(0)