зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1765339
- Update error handling in PipeToPump r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D144035
This commit is contained in:
Родитель
ec93876623
Коммит
7ce305f41c
|
@ -503,12 +503,16 @@ void PipeToPump::ShutdownWithActionAfterFinishedWrite(
|
|||
RefPtr<Promise> p = aAction(aCx, thisRefPtr, aError, rv);
|
||||
|
||||
// Error while calling actions above, continue immediately with finalization.
|
||||
rv.WouldReportJSException();
|
||||
if (rv.Failed()) {
|
||||
if (rv.MaybeSetPendingException(aCx)) {
|
||||
JS::Rooted<Maybe<JS::Value>> someError(aCx);
|
||||
|
||||
JS::Rooted<JS::Value> error(aCx);
|
||||
bool ok = ToJSValue(aCx, std::move(rv), &error);
|
||||
MOZ_RELEASE_ASSERT(ok, "must be ok");
|
||||
JS::Rooted<mozilla::Maybe<JS::Value>> someError(aCx, Some(error.get()));
|
||||
if (JS_GetPendingException(aCx, &error)) {
|
||||
someError = Some(error.get());
|
||||
}
|
||||
|
||||
JS_ClearPendingException(aCx);
|
||||
|
||||
Finalize(aCx, someError);
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче