Fix uncaught promise errors not showing up correctly in logs

pull/1301/head
Mikunj 5 years ago
parent fba84c0dbc
commit f19016b71b

@ -137,6 +137,6 @@ window.onerror = (message, script, line, col, error) => {
window.addEventListener('unhandledrejection', rejectionEvent => {
const error = rejectionEvent.reason;
const errorInfo = error && error.stack ? error.stack : JSON.stringify(error);
window.log.error(`Top-level unhandled promise rejection: ${errorInfo}`);
const errorInfo = error && error.stack ? error.stack : error;
window.log.error('Top-level unhandled promise rejection:', errorInfo);
});

@ -2210,6 +2210,7 @@
return;
}
try {
const profileKeyBuffer = window.Signal.Crypto.base64ToArrayBuffer(
profileKey
);
@ -2220,6 +2221,9 @@
accessKeyBuffer
);
this.set({ accessKey });
} catch (e) {
window.log.warn(`Failed to derive access key for ${this.id}`);
}
},
async upgradeMessages(messages) {

Loading…
Cancel
Save