Issue #2690 - Convert error from non-existing convenience function.

Didn't check that the convenience function existed for this. Throw the
error manually, instead.
TO-DO: Add these convenience functions for one-shot errors.
This commit is contained in:
Moonchild 2025-02-05 22:51:26 +01:00 committed by roytam1
commit 3d7a95ab44
2 changed files with 4 additions and 2 deletions

View file

@ -402,8 +402,9 @@ WebCryptoTask::FailWithError(nsresult aRv)
MOZ_ASSERT(IsOnOriginalThread());
if (aRv == NS_ERROR_DOM_TYPE_MISMATCH_ERR) {
mResultPromise->MaybeRejectWithTypeError(
"The operation could not be performed.");
ErrorResult rv;
rv.ThrowTypeError<MSG_DOM_OPERATION_FAILED>();
mResultPromise->MaybeReject(rv);
} else {
// Blindly convert nsresult to DOMException
// Individual tasks must ensure they pass the right values