Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WebTransportError

WebTransportError

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

TheWebTransportError interface of theWebTransport API represents an error related to the API, which can arise from server errors, network connection problems, or client-initiated abort operations (for example, arising from aWritableStream.abort() call).

DOMException WebTransportError

Constructor

WebTransportError()

Creates a newWebTransportError object instance.

Instance properties

Inherits properties from its parent,DOMException.

sourceRead only

Returns an enumerated value indicating the source of the error—can be eitherstream orsession.

streamErrorCodeRead only

Returns a number in the range 0-255 indicating the application protocol error code for this error, ornull if one is not available.

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
# webtransporterror

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp