Skip to content

Commit

Permalink
Suppress unwanted errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brookhong committed Nov 18, 2024
1 parent 5db21d4 commit 8663926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/background/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function startNative() {
nvimServer.instance = startNative();
} else {
delete nvimServer.instance;
LOG("error", "Failed to connect neovim, please make sure your neovim version 0.5 or above.");
LOG("warn", "Failed to connect neovim, please make sure your neovim version 0.5 or above.");
}
});
nm.onMessage.addListener(async (resp) => {
Expand Down
9 changes: 5 additions & 4 deletions src/background/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ function start(browser) {
}

function sendTabMessage(tabId, frameId, message, cb) {
if (frameId === -1) {
chrome.tabs.sendMessage(tabId, message);
} else {
chrome.tabs.sendMessage(tabId, message, {frameId: frameId});
const opts = (frameId === -1) ? undefined : {frameId: frameId};
// use catch to suppress Uncaught (in promise) Error on sending message to unsupported tabs like chrome://
const p = chrome.tabs.sendMessage(tabId, message, opts);
if (p) {
p.catch((e) => {});
}
}
var _lastActiveTabId = null;
Expand Down

0 comments on commit 8663926

Please sign in to comment.