Ensure that context is always provided for error logs
This commit is contained in:
parent
7418a5c663
commit
be087c3498
5 changed files with 18 additions and 5 deletions
5
main.js
5
main.js
|
@ -1527,7 +1527,10 @@ ipc.handle('show-calling-permissions-popup', async (event, forCamera) => {
|
|||
try {
|
||||
await showPermissionsPopupWindow(true, forCamera);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(
|
||||
'show-calling-permissions-popup error:',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
}
|
||||
});
|
||||
ipc.on('close-permissions-popup', () => {
|
||||
|
|
|
@ -60,7 +60,9 @@ export const CallingNotification: React.FC<PropsType> = React.memo(props => {
|
|||
callType = 'video';
|
||||
break;
|
||||
default:
|
||||
window.log.error(missingCaseError(props));
|
||||
window.log.error(
|
||||
`CallingNotification missing case: ${missingCaseError(props)}`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -865,7 +865,11 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
};
|
||||
}
|
||||
default:
|
||||
window.log.error(missingCaseError(callHistoryDetails));
|
||||
window.log.error(
|
||||
`getPropsForCallHistory: missing case ${missingCaseError(
|
||||
callHistoryDetails
|
||||
)}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,6 @@ export function assert(condition: unknown, message: string): asserts condition {
|
|||
}
|
||||
throw err;
|
||||
}
|
||||
log.error(err);
|
||||
log.error('assert failure:', err && err.stack ? err.stack : err);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,11 @@ export function getCallingNotificationText(
|
|||
case CallMode.Group:
|
||||
return getGroupCallNotificationText(notification, i18n);
|
||||
default:
|
||||
window.log.error(missingCaseError(notification));
|
||||
window.log.error(
|
||||
`getCallingNotificationText: missing case ${missingCaseError(
|
||||
notification
|
||||
)}`
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue