mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-18 22:14:23 +01:00
Add timeout message to the relay
This commit is contained in:
@@ -106,6 +106,8 @@ function connectStream(socket: WebSocket, ip: string | undefined) {
|
||||
} catch (e) {
|
||||
if (e instanceof RelayError) {
|
||||
send(['CLOSED', subId, e.message]);
|
||||
} else if (e.message.includes('timeout')) {
|
||||
send(['CLOSED', subId, 'error: the relay could not respond fast enough']);
|
||||
} else {
|
||||
send(['CLOSED', subId, 'error: something went wrong']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user