sentry.jade 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. - if (typeof(sentrySrc) != "undefined")
  2. - if (sentrySrc.match(/^([a-z]+:)?\/\//i))
  3. script(src="#{sentrySrc}")
  4. - else
  5. script(src="#{jsPath}libs/#{sentrySrc}")
  6. - if (typeof(sentrySrc) != "undefined")
  7. script(type="text/javascript").
  8. if (typeof(Raven) != "undefined" && Raven.config) {
  9. Raven.config("#{sentryPublicDSN}", {
  10. tags: { 'commit': '@@COMMIT@@', 'build': '@@RELEASE@@' },
  11. // Ignore list based off: https://gist.github.com/1878283
  12. ignoreErrors: [
  13. 'DealPly',
  14. // Random plugins/extensions
  15. 'top.GLOBALS',
  16. // See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
  17. 'originalCreateNotification',
  18. 'canvas.contentDocument',
  19. 'MyApp_RemoveAllHighlights',
  20. 'http://tt.epicplay.com',
  21. 'Can\'t find variable: ZiteReader',
  22. 'jigsaw is not defined',
  23. 'ComboSearch is not defined',
  24. 'http://loading.retry.widdit.com/',
  25. 'atomicFindClose',
  26. // Facebook borked
  27. 'fb_xd_fragment',
  28. // ISP optimizing proxy - `Cache-Control: no-transform` seems to reduce this. (thanks @acdha)
  29. // See http://stackoverflow.com/questions/4113268/how-to-stop-javascript-injection-from-vodafone-proxy
  30. 'bmi_SafeAddOnload',
  31. 'EBCallBackMessageReceived',
  32. // See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
  33. 'conduitPage'
  34. ],
  35. ignoreUrls: [
  36. // Facebook flakiness
  37. /graph\.facebook\.com/i,
  38. // Facebook blocked
  39. /connect\.facebook\.net\/en_US\/all\.js/i,
  40. // Woopra flakiness
  41. /eatdifferent\.com\.woopra-ns\.com/i,
  42. /static\.woopra\.com\/js\/woopra\.js/i,
  43. // Chrome extensions
  44. /extensions\//i,
  45. /^chrome:\/\//i,
  46. // Other plugins
  47. /127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
  48. /webappstoolbarba\.texthelp\.com\//i,
  49. /metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
  50. /a\.disquscdn\.com/i,
  51. /platform\.twitter\.com/i,
  52. /pstatic\.datafastguru\.info/i
  53. ],
  54. shouldSendCallback: function(data) {
  55. // only send a fraction of errors
  56. var sampleRate = 1.00;
  57. return (Math.random() <= sampleRate);
  58. },
  59. dataCallback: function(data) {
  60. // remove circular references from object
  61. var cache = [];
  62. var s = JSON.stringify(data, function(k, v) { if (typeof v === 'object' && v !== null) { if (cache.indexOf(v) !== -1) return "[circular]"; cache.push(v); }; return v; });
  63. return JSON.parse(s);
  64. }
  65. // we highly recommend restricting exceptions to a domain in order to filter out clutter
  66. // whitelistUrls: ['example.com/scripts/']
  67. }).install();
  68. }
  69. - if (typeof(user) != "undefined" && typeof (user.email) != "undefined")
  70. script(type="text/javascript").
  71. if (typeof(Raven) != "undefined" && Raven.setUserContext) {
  72. Raven.setUserContext({email: '#{user.email}'});
  73. }