-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Integrate sentry JS and remove raven (#4091)
- Loading branch information
1 parent
0456445
commit d26672c
Showing
12 changed files
with
199 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
import { Ember } from '@sentry/integrations'; | ||
import config from 'open-event-frontend/config/environment'; | ||
|
||
Sentry.init({ | ||
integrations: [new Ember()], | ||
beforeSend(event: Sentry.Event) { | ||
const exception = event.exception?.values?.[0]; | ||
const errorValue = exception?.value; | ||
if (errorValue?.includes("Ember Data Request") && | ||
errorValue?.includes("404")) { | ||
// Ignore 404 errors from Ember Data because | ||
// I don't know how to turn them off | ||
return null; | ||
} | ||
|
||
if (errorValue?.includes("TransitionAborted") && | ||
exception?.mechanism?.handled) { | ||
// Every page load has a handled TransitionAborted for some reason | ||
return null; | ||
} | ||
|
||
return event; | ||
}, | ||
...config.sentry | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Service from '@ember/service'; | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
export default class BugTracker extends Service { | ||
|
||
setUser(user: Sentry.User | null) { | ||
Sentry.setUser(user) | ||
} | ||
|
||
clearUser() { | ||
Sentry.setUser(null); | ||
} | ||
|
||
} | ||
|
||
// DO NOT DELETE: this is how TypeScript knows how to look up your services. | ||
declare module '@ember/service' { | ||
interface Registry { | ||
'bug-tracker': BugTracker; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Service | bug-tracker', function(hooks) { | ||
setupTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('it exists', function(assert) { | ||
let service = this.owner.lookup('service:bug-tracker'); | ||
assert.ok(service); | ||
}); | ||
}); |
Oops, something went wrong.