Bug 1612213 part 3. Switch Promise::RejectWithDOMException consumers to new convenience methods. r=smaug,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D61269
This commit is contained in:
@@ -7162,9 +7162,8 @@ already_AddRefed<Promise> HTMLMediaElement::SetMediaKeys(
|
||||
// 2. If this object's attaching media keys value is true, return a
|
||||
// promise rejected with a new DOMException whose name is InvalidStateError.
|
||||
if (mAttachingMediaKey) {
|
||||
promise->MaybeReject(
|
||||
NS_ERROR_DOM_INVALID_STATE_ERR,
|
||||
NS_LITERAL_CSTRING("A MediaKeys object is in attaching operation."));
|
||||
promise->MaybeRejectWithInvalidStateError(
|
||||
"A MediaKeys object is in attaching operation.");
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
@@ -7771,8 +7770,7 @@ already_AddRefed<Promise> HTMLMediaElement::SetSinkId(const nsAString& aSinkId,
|
||||
promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
|
||||
break;
|
||||
case NS_ERROR_NOT_AVAILABLE: {
|
||||
promise->MaybeRejectWithDOMException(
|
||||
NS_ERROR_DOM_NOT_FOUND_ERR,
|
||||
promise->MaybeRejectWithNotFoundError(
|
||||
"The object can not be found here.");
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user