Commit 2f1c0e2
authored
Fix update-release swallowing release source errors (#644)
## Summary
- When a release source returned a non-not-found error (e.g. a 401 auth
failure), `update-release` discarded the underlying error and returned a
generic `couldn't find "X" VERSION in any release source` message
- Both the `GetMatchedRelease` and `FindReleaseVersion` paths had this
bug
- Now wraps the underlying error with `%w` so the actual failure (source
ID, HTTP status, etc.) is surfaced to the user
Closes #520
## Test plan
- [x] Added two new test cases covering auth-style errors for both the
download and no-download paths — both previously failed and now pass
- [x] All existing `UpdateRelease` tests continue to pass (`go test
./internal/commands/`)
Made with [Cursor](https://cursor.com)2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 82 | + | |
86 | 83 | | |
87 | 84 | | |
88 | 85 | | |
| |||
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 98 | + | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
345 | 378 | | |
346 | 379 | | |
347 | 380 | | |
| |||
0 commit comments