mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
Clean up Sentry formatting of mailsync errors
This commit is contained in:
parent
f9f00498b8
commit
cdf059ab4f
2 changed files with 8 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue