mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +00:00
Merge pull request #3978 from balena-io/aethernet/fix-screensaver
fix disabled-screensaver unhandled exception outside balena-electron env
This commit is contained in:
commit
bd88e5a1ca
@ -47,7 +47,13 @@ export function isFlashing(): boolean {
|
||||
*/
|
||||
export function setFlashingFlag() {
|
||||
// see https://github.com/balenablocks/balena-electron-env/blob/4fce9c461f294d4a768db8f247eea6f75d7b08b0/README.md#remote-methods
|
||||
electron.ipcRenderer.invoke('disable-screensaver');
|
||||
try {
|
||||
electron.ipcRenderer.invoke('disable-screensaver');
|
||||
} catch (error) {
|
||||
console.log(
|
||||
"Can't disable-screensaver, we're probably not running on a balena-electron env",
|
||||
);
|
||||
}
|
||||
store.dispatch({
|
||||
type: Actions.SET_FLASHING_FLAG,
|
||||
data: {},
|
||||
|
@ -221,9 +221,9 @@ export async function logEvent(message: string, data: AnalyticsPayload = {}) {
|
||||
*/
|
||||
export function logException(error: any) {
|
||||
const shouldReportErrors = settings.getSync('errorReporting');
|
||||
console.error(error);
|
||||
if (shouldReportErrors) {
|
||||
initAnalytics();
|
||||
console.error(error);
|
||||
SentryRenderer.captureException(error);
|
||||
}
|
||||
}
|
||||
|
@ -65,8 +65,8 @@ async function checkForUpdates(interval: number) {
|
||||
|
||||
function logMainProcessException(error: any) {
|
||||
const shouldReportErrors = settings.getSync('errorReporting');
|
||||
console.error(error);
|
||||
if (shouldReportErrors) {
|
||||
console.error(error);
|
||||
SentryMain.captureException(error);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user