Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

filter the hash from error reports #402

Merged
merged 1 commit into from
Aug 2, 2017
Merged

filter the hash from error reports #402

merged 1 commit into from
Aug 2, 2017

Conversation

dannycoates
Copy link
Contributor

we don't want to know it

@dannycoates dannycoates requested a review from abhinadduri August 2, 2017 21:20
@dannycoates dannycoates force-pushed the filter-sentry branch 2 times, most recently from af2a473 to 5308a01 Compare August 2, 2017 21:56
dataCallback: function (data) {
var hash = window.location.hash;
if (hash) {
return JSON.parse(JSON.stringify(data).replace(new Regexp(hash.slice(1), 'g'), ''));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be RegExp (per MDN)?

I was going to see if ESLint caught that, but I guess this is a weird hybrid .handlebars file, which linting would never see.

Not sure if we need to wrap any of that in a try..catch() in case something implodes unexpectedly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think throwing is better in this case. It has the least surprising result, the report isn't sent. Returning null sends the original data including fragment, and returning {} also doesn't send the report but is less obvious what it might do.

@@ -92,6 +92,6 @@
"test": "npm-run-all test:*",
"test:unit": "mocha test/unit",
"test:server": "mocha test/server",
"test:browser": "browserify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d && node test/frontend/driver.js"
"test--browser": "browserify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d && node test/frontend/driver.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@dannycoates
Copy link
Contributor Author

I generated a test error, and the fragment is no longer included https://sentry.prod.mozaws.net/operations/send-dev/issues/633106/

@dannycoates dannycoates merged commit de826af into master Aug 2, 2017
@pdehaan pdehaan deleted the filter-sentry branch August 4, 2017 05:29
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants