Bug 1525966 - Support string errors when detach fails in target fronts r=nchevobbe

Depends on D55829

In case other rejects are still using strings instead of error objects.

Differential Revision: https://phabricator.services.mozilla.com/D55830

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-12-11 17:31:52 +00:00
parent 5bc4238d39
commit 5fb20254ae
3 changed files with 5 additions and 6 deletions

View File

@ -138,7 +138,8 @@ class BrowsingContextTargetFront extends TargetMixin(
response = await super.detach();
} catch (e) {
console.warn(
`Error while detaching the browsing context target front: ${e.message}`
"Error while detaching the browsing context target front:",
e
);
}

View File

@ -454,7 +454,7 @@ function TargetMixin(parentClass) {
} catch (e) {
// Ignore any errors while closing, since there is not much that can be done
// at this point.
console.warn(`Error while closing client: ${e.message}`);
console.warn("Error while closing client:", e);
}
// Not all targets supports attach/detach. For example content process doesn't.
@ -467,7 +467,7 @@ function TargetMixin(parentClass) {
try {
await this.detach();
} catch (e) {
console.warn(`Error while detaching target: ${e.message}`);
console.warn("Error while detaching target:", e);
}
}

View File

@ -92,9 +92,7 @@ class WorkerTargetFront extends TargetMixin(
try {
response = await super.detach();
} catch (e) {
console.warn(
`Error while detaching the worker target front: ${e.message}`
);
console.warn("Error while detaching the worker target front:", e);
}
if (this.registration) {