WebTransportError: source-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Sicherer Kontext: Diese Funktion ist nur in sicheren Kontexten (HTTPS) in einigen oder allen unterstützenden Browsern verfügbar.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die schreibgeschützte source
-Eigenschaft der WebTransportError
-Schnittstelle gibt einen Aufzählungswert zurück, der die Quelle des Fehlers angibt.
Wert
Ein Aufzählungswert; kann entweder stream
oder session
sein.
Beispiele
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);
}
}
Spezifikationen
Specification |
---|
WebTransport # dom-webtransporterror-source |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.