mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
Clean up Sentry formatting of mailsync errors
This commit is contained in:
parent
f9f00498b8
commit
cdf059ab4f
|
@ -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) {
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Reference in a new issue