mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 02:23:59 +00:00
Merge pull request #1868 from overleaf/bg-sanitise-error-for-google-analytics
sanitise error sent to google analytics GitOrigin-RevId: 6307b7a54f18b9e8a1da31f45a5a148e1321db62
This commit is contained in:
parent
08861187d5
commit
3ce74a3877
1 changed files with 8 additions and 1 deletions
|
@ -670,12 +670,19 @@ define([
|
|||
return
|
||||
}
|
||||
if (typeof ga === 'function') {
|
||||
// sanitise the error message before sending (the "delete component"
|
||||
// error in public/js/libs/sharejs.js includes the some document
|
||||
// content).
|
||||
let message = error.message
|
||||
if (/^Delete component/.test(message)) {
|
||||
message = 'Delete component does not match deleted text'
|
||||
}
|
||||
ga(
|
||||
'send',
|
||||
'event',
|
||||
'error',
|
||||
'shareJsError',
|
||||
`${error.message} - ${this.ide.socket.socket.transport.name}`
|
||||
`${message} - ${this.ide.socket.socket.transport.name}`
|
||||
)
|
||||
}
|
||||
if (this.doc != null) {
|
||||
|
|
Loading…
Reference in a new issue