MDN Web Docs

Value

An enumerated value; can be either stream or session.

Examples

js

const url = "not-a-url";
async function initTransport(url) {
  try {
    // Initialize transport connection
    const transport = new WebTransport(url);
    // The connection can be used once ready fulfills
    await transport.ready;
    // …
  } catch (error) {
    const msg = `Transport initialization failed.
                 Reason: ${error.message}.
                 Source: ${error.source}.
                 Error code: ${error.streamErrorCode}.`;
    console.log(msg);
  }
}

Specifications

Specification
WebTransport
# dom-webtransporterror-source

Browser compatibility

See also

Help improve MDN

Yes No

Learn how to contribute

This page was last modified on by MDN contributors.

Read the original on developer.mozilla.org ↗