fix: isNetworkError should use errors.As, not a bare type assertion #84

Merged
benvin merged 1 commits from benvin/isnetworkerror-errors-as into master 2026-07-02 20:18:24 +10:00
Owner

Fixes #68

Why

isNetworkError type-asserted err.(*UpstreamError) directly. If the error is ever wrapped, stale-on-error handling silently stops triggering.

Changes

  • Use errors.As to detect *UpstreamError through wrapping.

Validation

  • make e2e passes.
Fixes #68 ## Why `isNetworkError` type-asserted `err.(*UpstreamError)` directly. If the error is ever wrapped, stale-on-error handling silently stops triggering. ## Changes - Use `errors.As` to detect `*UpstreamError` through wrapping. ## Validation - `make e2e` passes.
unkinben added 1 commit 2026-07-02 00:27:45 +10:00
fix: detect UpstreamError with errors.As in isNetworkError
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
b125630a86
The stale-on-error path used a bare type assertion, which fails if the
UpstreamError is ever wrapped. Use errors.As so wrapping is handled.

Refs #68
benvin merged commit 0a89b2005c into master 2026-07-02 20:18:24 +10:00
benvin deleted branch benvin/isnetworkerror-errors-as 2026-07-02 20:18:24 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/artifactapi#84