feat(relay): send custom error messages - since, until & kind

This commit is contained in:
P. Reis 2024-07-02 17:09:17 -03:00
parent c7092f5d2d
commit a7f2fb06ee

View file

@ -77,7 +77,10 @@ function connectStream(socket: WebSocket) {
send(['EVENT', subId, event]);
}
} catch (e) {
if (e instanceof RelayError) {
if (
e instanceof RelayError ||
e.message.slice(-('filter too far into the future'.length)) === 'filter too far into the future'
) {
send(['CLOSED', subId, e.message]);
} else {
send(['CLOSED', subId, 'error: something went wrong']);