From 81f504c5ef603b7f4179452c0b6b10cdbeec69c9 Mon Sep 17 00:00:00 2001 From: Jonas Gloning <34194370+jonasgloning@users.noreply.github.com> Date: Sat, 2 Sep 2023 18:16:51 +0200 Subject: [PATCH] docs: urge the user to listen to the `error` event --- lib/peer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/peer.ts b/lib/peer.ts index fac46a95b..8f901daa4 100644 --- a/lib/peer.ts +++ b/lib/peer.ts @@ -495,7 +495,11 @@ export class Peer extends EventEmitterWithError { /** * Connects to the remote peer specified by id and returns a data connection. - * @param peer The brokering ID of the remote peer (their {@apilink Peer.id}). + * + * Make sure to listen to the `error` event of the resulting {@link DataConnection} + * in case the connection fails. + * + * @param peer The brokering ID of the remote peer (their {@link Peer.id}). * @param options for specifying details about Peer Connection */ connect(peer: string, options: PeerConnectOption = {}): DataConnection {