Scope watchpr's terminal 404 to the PR lookup
Only a 404 from GetPR means the PR is gone. A 404 from any other call can be a proxy or ingress blip, so it now warns and counts against the consecutive-failure cap instead of killing the watch on first sight.
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ func runWatch(c *agent.GiteaClient, refs []agent.PRRef, interval time.Duration,
|
||||
if agent.IsAuthError(err) {
|
||||
return fmt.Errorf("gitea authentication failed after re-minting the token, watch aborted: %w", err)
|
||||
}
|
||||
if agent.IsNotFound(err) {
|
||||
if agent.IsPRGone(err) {
|
||||
return fmt.Errorf("PR no longer visible (repo deleted, renamed, or made private), watch aborted: %w", err)
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user