-
Notifications
You must be signed in to change notification settings - Fork 23.2k
RTCError and RTCErrorEvent docs #44047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hamishwillee
wants to merge
1
commit into
mdn:main
Choose a base branch
from
hamishwillee:ff150_rtc_error_doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: "RTCError: RTCError() constructor" | ||
| short-title: RTCError() | ||
| slug: Web/API/RTCError/RTCError | ||
| page-type: web-api-constructor | ||
| browser-compat: api.RTCError.RTCError | ||
| --- | ||
|
|
||
| {{APIRef("WebRTC")}} | ||
|
|
||
| The **`RTCError()`** constructor creates and returns a new {{domxref("RTCError")}} object initialized with the different parameters and, optionally, a string to use as the value of the error's message property. | ||
|
|
||
| ## Syntax | ||
|
|
||
| ```js-nolint | ||
| new RTCError(options) | ||
| new RTCError(options, message) | ||
| ``` | ||
|
|
||
| ### Parameters | ||
|
|
||
| - `options` | ||
| - : An object that can be provided to set the details of the specific error in an RTCErrorEvent. | ||
| The object has the following properties: | ||
| - `errorDetail` | ||
| - : A string specifying the WebRTC-specific error code identifying the type of error that occurred. | ||
| This will be one of: | ||
| - `data-channel-failure` | ||
| - : The connection's {{domxref("RTCDataChannel")}} has failed. | ||
| - `dtls-failure` | ||
| - : The negotiation of the {{Glossary("DTLS")}} connection failed, or the connection was terminated with a fatal error. | ||
| The error's {{domxref("DOMException.message", "message")}} contains details about the nature of the error. | ||
| - If a fatal error is _received_, set [`receivedAlert`](#receivedalert) to the value of the received DTLSL alert. | ||
| - If a fatal error was _sent_, set [`sentAlert`](#sentalert) to the alert's value. | ||
| - `fingerprint-failure` | ||
| - : The remote certificate for the {{domxref("RTCDtlsTransport")}} didn't match any of the fingerprints listed in the SDP. | ||
| If the remote peer can't match the local certificate against the provided fingerprints, this error doesn't occur, though this situation may result instead in a `dtls-failure` error. | ||
| - `hardware-encoder-error` | ||
| - : The hardware encoder doesn't support the given configuration parameters. | ||
| - `hardware-encoder-not-available` | ||
| - : The hardware encoder resources required to accomplish the requested operation aren't available. | ||
| - `sctp-failure` | ||
| - : The {{Glossary("SCTP")}} negotiation has failed, or the connection has terminated with a fatal error. | ||
| The SCTP cause code should be set in [`sctpCauseCode`](#sctpcausecode). | ||
| SCTP error cause codes 1-13 are defined in the SCTP specification: {{RFC(4960, "", "3.3.10")}}. | ||
| - `sdp-syntax-error` | ||
| - : The SDP syntax is invalid. | ||
| The line number within the SDP at which the error was detected should be set in [`sdpLineNumber`](#sdplinenumber). | ||
|
|
||
| - `receivedAlert` {{optional_inline}} | ||
| - : A positive integer value indicating a fatal {{Glossary("DTLS")}} error that was received from the network. | ||
| Only set if the `errorDetail` string is `dtls-failure`. | ||
|
|
||
| - `sctpCauseCode` {{optional_inline}} | ||
| - : An integer specifying the {{Glossary("SCTP")}} cause code that indicates the cause of the failed SCTP negotiation. | ||
| This should only be set if `errorDetail` is `sctp-failure`. | ||
|
|
||
| - `sdpLineNumber` {{optional_inline}} | ||
| - : An integer identifying the line number of the {{Glossary("SDP")}} on which a syntax error occurred. | ||
| Only set if `errorDetail` is `sdp-syntax-error`. | ||
| - `sentAlert` {{optional_inline}} | ||
| - : A positive integer indicating s fatal DTLS error that was sent out by this device. | ||
| Only set is `errorDetail` is `dtls-failure`. | ||
|
|
||
| - `message` {{optional_inline}} | ||
| - : A string for the error message. | ||
| Defaults to the empty string (`""`). | ||
|
|
||
| ### Return value | ||
|
|
||
| A newly-created {{domxref("RTCError")}} object. | ||
| The properties of the object are set to the values passed in the [`options`](#options) parameter, or otherwise `null`. | ||
|
|
||
| ## Usage notes | ||
|
|
||
| This constructor does not do complete validation of the specified `candidateInfo` object or string. | ||
|
|
||
| ## Specifications | ||
|
|
||
| {{Specifications}} | ||
|
|
||
| ## Browser compatibility | ||
|
|
||
| {{Compat}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[markdownlint] reported by reviewdog 🐶
error MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "Also inherits properties from ..."]