mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor(EventsDB): throw RelayError instead of Error
This commit is contained in:
parent
2d017e8102
commit
e169749b82
1 changed files with 3 additions and 3 deletions
|
|
@ -147,14 +147,14 @@ class EventsDB implements NStore {
|
||||||
|
|
||||||
for (const filter of filters) {
|
for (const filter of filters) {
|
||||||
if (filter.since && filter.since >= 2_147_483_647) {
|
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) {
|
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 ?? []) {
|
for (const kind of filter.kinds ?? []) {
|
||||||
if (kind >= 2_147_483_647) {
|
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue