window.onerror = function (message, source, lineno, colno, error) {
  logError(error);
};

window.onerror = function (message, source, lineno, colno, error) {
  logError(error instanceof Error ? error : new Error(error || message));
};

Improve logging of errors in renderer
Improve logging of errors in renderer
