Browse Source

Add raven-js/Sentry support

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
07314271b4
  1. 3
      app.js
  2. 3
      bower.json
  3. 1
      etc/config/gcc-explorer.amazon.properties
  4. 1
      etc/config/gcc-explorer.lud-ldnmg01.properties
  5. 5
      static/analytics.js
  6. 8
      static/main.js

3
app.js

@ -145,7 +145,8 @@ function clientOptionsHandler(compilers, fileSources) {
compileOptions: compilerProps("options"),
supportsBinary: !!compilerProps("supportsBinary"),
postProcess: compilerProps("postProcess"),
sources: sources
sources: sources,
raven: gccProps('ravenUrl', '')
};
var text = JSON.stringify(options);
return function getClientOptions(req, res) {

3
bower.json

@ -25,6 +25,7 @@
"selectize": "^0.12.2",
"eventEmitter": "^5.1.0",
"lz-string": "^1.4.4",
"clipboard": "^1.5.12"
"clipboard": "^1.5.12",
"raven-js": "^3.7.0"
}
}

1
etc/config/gcc-explorer.amazon.properties

@ -8,3 +8,4 @@ cacheMb=50
clientGoogleAnalyticsEnabled=true
proxyRetries=300
proxyRetryMs=500
ravenUrl=https://4574a044b9f8442f86c2ce14490255f1@sentry.io/102028

1
etc/config/gcc-explorer.lud-ldnmg01.properties

@ -1,2 +1,3 @@
language=C++
clientURLShortener=google
ravenUrl=https://4574a044b9f8442f86c2ce14490255f1@sentry.io/102028

5
static/analytics.js

@ -26,6 +26,11 @@
define(function (require, exports) {
"use strict";
var options = require('options');
var Raven = require('raven-js');
if (options.raven) {
Raven.config(options.raven).install();
}
if (options.googleAnalyticsEnabled) {
(function (i, s, o, g, r, a, m) {

8
static/main.js

@ -34,7 +34,8 @@ require.config({
microplugin: 'ext/microplugin/src/microplugin',
events: 'ext/eventEmitter/EventEmitter',
lzstring: 'ext/lz-string/libs/lz-string',
clipboard: 'ext/clipboard/dist/clipboard'
clipboard: 'ext/clipboard/dist/clipboard',
'raven-js': 'ext/raven-js/dist/raven'
},
packages: [{
name: "codemirror",
@ -61,6 +62,7 @@ define(function (require) {
var clipboard = require('clipboard');
var Hub = require('hub');
var shortenURL = require('urlshorten-google');
var Raven = require('raven-js');
analytics.initialise();
sharing.initialise();
@ -95,7 +97,7 @@ define(function (require) {
try {
layout = new GoldenLayout(config, root);
} catch (e) {
console.log("Caught " + e + " during layout; using default layout");
Raven.captureException(e);
layout = new GoldenLayout(defaultConfig, root);
}
layout.on('stateChanged', function () {
@ -155,7 +157,7 @@ define(function (require) {
}
initPopover($("#get-full-link"), function (done) {
done(permalink)
done(permalink);
});
initPopover($("#get-short-link"), function (done) {
shortenURL(permalink(), done);

Loading…
Cancel
Save