mirror of
https://github.com/fiatjaf/nak.git
synced 2026-06-06 10:41:23 +02:00
fetch: exit with error if event is not fetched.
This commit is contained in:
6
fetch.go
6
fetch.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user