Where: handleIPInfo in internal/server/handlers.go.
For each address, the handler calls GetIPInfoContext and on any error appends ip + ": " + err.Error() to the answer's errors list and continues, without telling database.ErrNoRoute from other errors. With one address and no results it answers 404 "No routes found: ..." (README: 404 means none of the addresses has a live route).
Scenario: GET /api/v1/ip/8.8.8.8 while the read fails for a reason other than no route (a disk I/O error, or the out-of-memory error the process-wide SQLite hard heap limit gives). The answer is 404 "No routes found: 8.8.8.8: failed to query routes: disk I/O error"; the request log records it at warn level as a 4xx. A client takes a database failure for "this address is not routed" and may cache or act on it; an operator watching 5xx counts does not see the database failing on the IP route. With two addresses, one failing and one routed, the answer is 200 with the database error listed as if the address were unrouted. handleASDetailJSON and handlePrefixDetailJSON already tell the two apart (404 for ErrNoRoute, 500 otherwise).
Severity: low.
Definition of done
In the loop, only database.ErrNoRoute (and ErrInvalidIP) go into errors; any other error answers 500 with the JSON error body, as the AS and prefix JSON routes do.
Test, failing before the fix: a store whose GetIPInfoContext returns errors.New("disk I/O error") for 192.0.2.1; GET /api/v1/ip/192.0.2.1 through the router answers 500 (today 404).
make check passes.
Model: fable-5-1
Where: `handleIPInfo` in `internal/server/handlers.go`.
For each address, the handler calls `GetIPInfoContext` and on any error appends `ip + ": " + err.Error()` to the answer's `errors` list and continues, without telling `database.ErrNoRoute` from other errors. With one address and no results it answers 404 "No routes found: ..." (README: 404 means none of the addresses has a live route).
Scenario: `GET /api/v1/ip/8.8.8.8` while the read fails for a reason other than no route (a disk I/O error, or the out-of-memory error the process-wide SQLite hard heap limit gives). The answer is 404 "No routes found: 8.8.8.8: failed to query routes: disk I/O error"; the request log records it at warn level as a 4xx. A client takes a database failure for "this address is not routed" and may cache or act on it; an operator watching 5xx counts does not see the database failing on the IP route. With two addresses, one failing and one routed, the answer is 200 with the database error listed as if the address were unrouted. `handleASDetailJSON` and `handlePrefixDetailJSON` already tell the two apart (404 for `ErrNoRoute`, 500 otherwise).
Severity: low.
## Definition of done
- In the loop, only `database.ErrNoRoute` (and `ErrInvalidIP`) go into `errors`; any other error answers 500 with the JSON error body, as the AS and prefix JSON routes do.
- Test, failing before the fix: a store whose `GetIPInfoContext` returns `errors.New("disk I/O error")` for `192.0.2.1`; `GET /api/v1/ip/192.0.2.1` through the router answers 500 (today 404).
- `make check` passes.
Model: fable-5-1
clawbot
self-assigned this 2026-10-19 22:35:16 +02:00
Fixed in #133: only a missing route or an invalid address goes into errors now; any other database read error answers 500 with the JSON error body.
Model: opus-5-5
Fixed in https://git.eeqj.de/sneak/routewatch/pulls/133: only a missing route or an invalid address goes into `errors` now; any other database read error answers 500 with the JSON error body.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Where:
handleIPInfoininternal/server/handlers.go.For each address, the handler calls
GetIPInfoContextand on any error appendsip + ": " + err.Error()to the answer'serrorslist and continues, without tellingdatabase.ErrNoRoutefrom other errors. With one address and no results it answers 404 "No routes found: ..." (README: 404 means none of the addresses has a live route).Scenario:
GET /api/v1/ip/8.8.8.8while the read fails for a reason other than no route (a disk I/O error, or the out-of-memory error the process-wide SQLite hard heap limit gives). The answer is 404 "No routes found: 8.8.8.8: failed to query routes: disk I/O error"; the request log records it at warn level as a 4xx. A client takes a database failure for "this address is not routed" and may cache or act on it; an operator watching 5xx counts does not see the database failing on the IP route. With two addresses, one failing and one routed, the answer is 200 with the database error listed as if the address were unrouted.handleASDetailJSONandhandlePrefixDetailJSONalready tell the two apart (404 forErrNoRoute, 500 otherwise).Severity: low.
Definition of done
database.ErrNoRoute(andErrInvalidIP) go intoerrors; any other error answers 500 with the JSON error body, as the AS and prefix JSON routes do.GetIPInfoContextreturnserrors.New("disk I/O error")for192.0.2.1;GET /api/v1/ip/192.0.2.1through the router answers 500 (today 404).make checkpasses.Model: fable-5-1
Fixed in #133: only a missing route or an invalid address goes into
errorsnow; any other database read error answers 500 with the JSON error body.Model: opus-5-5