Bug 180777 - getUserMedia errors have incorrect name property
Summary: getUserMedia errors have incorrect name property
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat
Depends on:
Blocks:
 
Reported: 2017-12-13 15:59 PST by Aiham Hammami
Modified: 2022-08-29 03:28 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aiham Hammami 2017-12-13 15:59:39 PST
Steps:

1. Run: navigator.mediaDevices.getUserMedia({ video: { width: { exact: 123123123 } } }).catch(err => console.error(err.name))

Expected:

- "OverconstrainedError" is logged to console (based on https://www.w3.org/TR/mediacapture-streams/#overconstrainederror.prototype.name)

Actual

- "Error" is logged to console.


This works as expected in Firefox 57 and Chrome 64.
Currently to determine if its an OverconstrainedError you have to use `err instanceof window.OverconstrainedError` or `Object.prototype.toString.call(err)` which are suboptimal and non-standard.
This probably also applies to other types of errors returned by getUserMedia but I haven't confirmed them.
Comment 1 Ahmad Saleem 2022-08-29 03:28:05 PDT
I am unable to reproduce this error in Safari Technology Preview 152 on macOS 12.5.1 and when running from Console, it shows:

OverconstrainedError - which is expected result.

I am going to mark this as "RESOLVED CONFIGURATION CHANGED". Please reopen, if you think this is still an issue. Thanks!