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 source
schreibgeschützte Eigenschaft des WebTransportError
-Interfaces gibt einen enumerierten Wert zurück, der die Quelle des Fehlers angibt.
Wert
Ein enumerierter Wert; 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
Loading…