From e169749b8279943bef8f63cb8c3046c7f6c4fd09 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 2 Jul 2024 18:39:55 -0300 Subject: [PATCH] refactor(EventsDB): throw RelayError instead of Error --- src/storages/EventsDB.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storages/EventsDB.ts b/src/storages/EventsDB.ts index 69959fc0..ce74f20d 100644 --- a/src/storages/EventsDB.ts +++ b/src/storages/EventsDB.ts @@ -147,14 +147,14 @@ class EventsDB implements NStore { for (const filter of filters) { if (filter.since && filter.since >= 2_147_483_647) { - throw new Error('since filter too far into the future'); + throw new RelayError('invalid', 'since filter too far into the future'); } if (filter.until && filter.until >= 2_147_483_647) { - throw new Error('until filter too far into the future'); + throw new RelayError('invalid', 'until filter too far into the future'); } for (const kind of filter.kinds ?? []) { if (kind >= 2_147_483_647) { - throw new Error('kind filter too far into the future'); + throw new RelayError('invalid', 'kind filter too far into the future'); } } }