Improve error handling in ChromeObject

Enhanced error handling by returning a structured error object when exceptions occur in ChromeObject. Also updated the version info to 0.5.2.
This commit is contained in:
Namhyeon Go 2025-08-11 04:52:38 +09:00
parent 1533059e44
commit 7a05916319

View File

@ -445,13 +445,16 @@ var ChromeObject = function() {
if ("result" in response) {
(function(r) {
if ("subtype" in r && r.subtype == "error") {
console.warn("[WebBrowser]", r.description);
console.warn(r.description);
}
})(response.result.result);
}
} catch (e) {
console.warn(e.message);
response = {};
response = {
error: true,
message: e && e.message ? e.message : "Request failed"
};
}
pageEventId.set(pageEventId.get() + 1);
@ -1504,7 +1507,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
exports.publisherName = publisherName;
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.5.1";
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.5.2";
exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global;
exports.require = global.require;