sentry.jade 2.8 KB

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