Remove e: any from error handlers

This commit is contained in:
Alex Gleason
2024-11-22 10:26:30 -06:00
parent ebaf2b9c59
commit 4eb7ea2461
4 changed files with 9 additions and 9 deletions

View File

@@ -108,10 +108,10 @@ function connectStream(socket: WebSocket, ip: string | undefined) {
for (const event of await store.query(filters, { limit: FILTER_LIMIT, timeout: Conf.db.timeouts.relay })) {
send(['EVENT', subId, purifyEvent(event)]);
}
} catch (e: any) {
} catch (e) {
if (e instanceof RelayError) {
send(['CLOSED', subId, e.message]);
} else if (e.message.includes('timeout')) {
} else if (e instanceof Error && e.message.includes('timeout')) {
send(['CLOSED', subId, 'error: the relay could not respond fast enough']);
} else {
send(['CLOSED', subId, 'error: something went wrong']);