event: exit with error when all the publishes fail.

This commit is contained in:
fiatjaf
2026-07-22 12:12:27 -03:00
parent a3890c4976
commit 5a82298d95

View File

@@ -588,6 +588,10 @@ func publishFlow(ctx context.Context, c *cli.Command, kr nostr.Signer, evt nostr
if len(successRelays) > 0 && c.Bool("nevent") {
log(nip19.EncodeNevent(evt.ID, successRelays, evt.PubKey) + "\n")
}
if len(successRelays) == 0 {
return fmt.Errorf("failed to publish to any of the relays")
}
}
return nil