fetch: exit with error if event is not fetched.

This commit is contained in:
fiatjaf
2026-04-02 03:59:45 -03:00
parent 2bc1cf3417
commit b811396d8b
3 changed files with 9 additions and 3 deletions

View File

@@ -106,11 +106,17 @@ var fetch = &cli.Command{
continue
}
found := false
for ie := range sys.Pool.FetchMany(ctx, relays, filter, nostr.SubscriptionOptions{
Label: "nak-fetch",
}) {
found = true
stdout(ie.Event)
}
if !found {
ctx = lineProcessingError(ctx, "no events found for %s", code)
}
}
exitIfLineProcessingError(ctx)