mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-20 15:04:20 +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) {
|
} catch (e) {
|
||||||
if (e instanceof RelayError) {
|
if (e instanceof RelayError) {
|
||||||
send(['CLOSED', subId, e.message]);
|
send(['CLOSED', subId, e.message]);
|
||||||
|
} else if (e.message.includes('timeout')) {
|
||||||
|
send(['CLOSED', subId, 'error: the relay could not respond fast enough']);
|
||||||
} else {
|
} else {
|
||||||
send(['CLOSED', subId, 'error: something went wrong']);
|
send(['CLOSED', subId, 'error: something went wrong']);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user