Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / SimulatorSocketErrorKind

Type Alias: SimulatorSocketErrorKind ​

SimulatorSocketErrorKind = "unreachable" | "timeout" | "closed-before-welcome" | "rejected"

Defined in: packages/ts-sdk/src/internal/errors.ts:77

Why a simulator socket connection failed.

  • unreachable: transport-level failure (offline, refused, DNS, reset).
  • timeout: the handshake never completed within its deadline.
  • closed-before-welcome: the server closed cleanly mid-handshake.
  • rejected: the server refused the connection with a machine-readable close frame; see SimulatorSocketError.serverCode.

Example:

ts
import type { SimulatorSocketErrorKind } from '@my-swu/simulator-client'

// 'rejected' is the only kind that carries a server-authored error code.
const simulatorSocketErrorKind: SimulatorSocketErrorKind = 'rejected'

console.log(simulatorSocketErrorKind)

Released under the MIT License.