From bde7d1c3fa95f45908370c6dfadde0c713416d30 Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Tue, 12 Nov 2024 18:00:18 -0500 Subject: [PATCH] make negentropy error message format match NIP-01 --- 77.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/77.md b/77.md index 152b6daa..ffdb436a 100644 --- a/77.md +++ b/77.md @@ -55,13 +55,17 @@ If a request cannot be serviced by the relay, an error is returned to the client ] ``` -Current reason codes are: +Error reasons are the same format as in NIP-01. They should begin with a machine-readable single-word prefix, followed by a `:` and then a human-readable message with more information. -* `RESULTS_TOO_BIG` +The current suggested error reasons are + +* `blocked` * Relays can optionally reject queries that would require them to process too many records, or records that are too old * The maximum number of records that can be processed can optionally be returned as the 4th element in the response -* `CLOSED` + * Example: `blocked: this query is too big` +* `closed` * Because the `NEG-OPEN` queries may be stateful, relays may choose to time-out inactive queries to recover memory resources + * Example: `closed: you took too long to respond!` After a `NEG-ERR` is issued, the subscription is considered to be closed.