Clean up Sentry formatting of mailsync errors

This commit is contained in:
Ben Gotow 2017-10-03 14:35:58 -07:00
parent f9f00498b8
commit cdf059ab4f
2 changed files with 8 additions and 5 deletions

View file

@ -29,9 +29,7 @@ module.exports = class RavenErrorReporter {
}
getVersion() {
return process.type === 'renderer'
? AppEnv.getVersion()
: require('electron').app.getVersion();
return process.type === 'renderer' ? AppEnv.getVersion() : require('electron').app.getVersion();
}
reportError(err, extra) {

View file

@ -51,11 +51,16 @@ class CrashTracker {
const lines = message
.split('\n')
.map(l => l.replace(/\*\*\*/g, '').trim())
.filter(l => !l.startsWith('[') && !l.startsWith('Error: null['));
.filter(l => !/^[\d|[ ]+/.test(l) && !l.startsWith('Error: null'));
message = `${overview}:\n${lines.join('\n')}`;
}
if (stack) {
const lines = stack.split('\n').map(l => l.replace(/\*\*\*/g, '').trim());
const lines = stack.split('\n').map(l =>
l
.replace(/\*\*\*/g, '')
.replace('in mailsync ', '')
.trim()
);
lines.shift();
message = `${message}${lines[0]}`;
stack = lines.join('\n');