Skip to main content
Version: v10.0.0

ConnectionLossType

Why a connection or a connection attempt ended. Every field is optional - a transport reports what it knows.


Import
import { ConnectionLossType } from "@hyper-fetch/sockets"

Preview​

type ConnectionLossType = {
code?: number;
error?: Error;
reason?: string;
}

Structure​

ConnectionLossType
NameTypeDescription
code
number

Close code of the transport, e.g. a WebSocket close code

error
Error

Error that ended the connection - a transport error, the connection timeout or a heartbeat timeout

reason
string

Close reason sent with the code