Reject with a consistent error
This commit is contained in:
parent
5a5c18371c
commit
7697643966
@ -802,7 +802,7 @@ class Backend {
|
|||||||
chrome.tabs.update(tab.id, {active: true}, () => {
|
chrome.tabs.update(tab.id, {active: true}, () => {
|
||||||
const e = chrome.runtime.lastError;
|
const e = chrome.runtime.lastError;
|
||||||
if (e) {
|
if (e) {
|
||||||
reject(e);
|
reject(new Error(e.message));
|
||||||
} else {
|
} else {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
@ -819,7 +819,7 @@ class Backend {
|
|||||||
chrome.windows.get(tab.windowId, {}, (value) => {
|
chrome.windows.get(tab.windowId, {}, (value) => {
|
||||||
const e = chrome.runtime.lastError;
|
const e = chrome.runtime.lastError;
|
||||||
if (e) {
|
if (e) {
|
||||||
reject(e);
|
reject(new Error(e.message));
|
||||||
} else {
|
} else {
|
||||||
resolve(value);
|
resolve(value);
|
||||||
}
|
}
|
||||||
@ -830,7 +830,7 @@ class Backend {
|
|||||||
chrome.windows.update(tab.windowId, {focused: true}, () => {
|
chrome.windows.update(tab.windowId, {focused: true}, () => {
|
||||||
const e = chrome.runtime.lastError;
|
const e = chrome.runtime.lastError;
|
||||||
if (e) {
|
if (e) {
|
||||||
reject(e);
|
reject(new Error(e.message));
|
||||||
} else {
|
} else {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user