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() { getVersion() {
return process.type === 'renderer' return process.type === 'renderer' ? AppEnv.getVersion() : require('electron').app.getVersion();
? AppEnv.getVersion()
: require('electron').app.getVersion();
} }
reportError(err, extra) { reportError(err, extra) {

View file

@ -51,11 +51,16 @@ class CrashTracker {
const lines = message const lines = message
.split('\n') .split('\n')
.map(l => l.replace(/\*\*\*/g, '').trim()) .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')}`; message = `${overview}:\n${lines.join('\n')}`;
} }
if (stack) { 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(); lines.shift();
message = `${message}${lines[0]}`; message = `${message}${lines[0]}`;
stack = lines.join('\n'); stack = lines.join('\n');