How to use the raven-js.context function in raven-js

To help you get started, we’ve selected a few raven-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OasisDEX / oasis-react / src / index.js View on Github external
const nodeType = await Network.checkConnectivity();
        dispatch(
          platformReducer.actions.setActiveNodeType(nodeType)
        );
        await onSuccessfulCheck({ dispatch, getState });
      }
    } catch (error) {
      console.debug("Error in healthCheck!", error.toString());
      dispatch(networkReducer.actions.setNoProviderConnected(true));
      dispatch(networkReducer.actions.disconnected());
      // setTimeout(() => location.reload(true), 5000);
    }
  }, 1000, dispatch, getState);
};

Raven.context(function() {
  (async () => {
    try {
      await bootstrap();
    } catch (e) {
      console.log(e);
    }
    ReactDOM.render(
      
        
          
        
      ,
      document.getElementById("root")
    );
  })();
});
github sampotts / plyr / demo / src / js / demo.js View on Github external
document.addEventListener('DOMContentLoaded', () => {
        Raven.context(() => {
            if (window.shr) {
                window.shr.setup({
                    count: {
                        classname: 'button__count',
                    },
                });
            }

            // Setup tab focus
            const tabClassName = 'tab-focus';

            // Remove class on blur
            document.addEventListener('focusout', event => {
                event.target.classList.remove(tabClassName);
            });
github sampotts / plyr / demo / src / js / demo.js View on Github external
document.addEventListener('DOMContentLoaded', () => {
        Raven.context(() => {
            const selector = '#player';
            const container = document.getElementById('container');

            if (window.Shr) {
                window.Shr.setup('.js-shr-button', {
                    count: {
                        classname: 'button__count',
                    },
                });
            }

            // Setup tab focus
            const tabClassName = 'tab-focus';

            // Remove class on blur
            document.addEventListener('focusout', event => {
github DefinitelyTyped / DefinitelyTyped / raven-js / raven-js-tests.ts View on Github external
]
    }
).install();

var throwsError = () => {
    throw new Error('broken');
};

try {
    throwsError();
} catch(e) {
    RavenJS.captureException(e);
    RavenJS.captureException(e, {tags: { key: "value" }});
}

RavenJS.context(throwsError);
RavenJS.context({tags: { key: "value" }}, throwsError);
RavenJS.context({extra: {planet: {name: 'Earth'}}}, throwsError);

setTimeout(RavenJS.wrap(throwsError), 1000);
RavenJS.wrap({logger: "my.module"}, throwsError)();
RavenJS.wrap({tags: {git_commit: 'c0deb10c4'}}, throwsError)();

RavenJS.setUserContext({
    email: 'matt@example.com',
    id: '123'
});

RavenJS.captureMessage('Broken!');
RavenJS.captureMessage('Broken!', {tags: { key: "value" }});

RavenJS.showReportDialog({
github Shyam-Chen / Svelte-Starter / src / app.js View on Github external
}
          };
        }
      };
    })
    .catch((error) => {
      console.error('Error during service worker registration:', error);
    });
}

/**
 * @name bootstrap-app
 */
if (process.env.NODE_ENV === 'production') {
  Raven.config(process.env.SENTRY_URL).install();
  Raven.context(() => pages());
} else {
  pages();
}
github GetStream / Winds / app / src / index.js View on Github external
import StreamAnalytics from 'stream-analytics';

import config from './config';

Raven.config(config.sentry, {
	release: config.version,
}).install();

window.streamClient = stream.connect(config.stream.apiKey, null, config.stream.appID);

window.streamAnalyticsClient = new StreamAnalytics({
	apiKey: config.stream.apiKey,
	token: config.stream.analyticsKey,
});

Raven.context(() => {
	ReactDOM.render(, document.getElementById('root'));
});
github willyb321 / media_mate / app / renderjs / downloader.js View on Github external
}, (err, docs) => {
		if (err) {
			log.info('DOWNLOADER: Error in ignoreDupeTorrents (db.find)');
			Raven.captureException(err);
			Raven.showReportDialog();
		}
		if (docs.length > 0) {
			if (docs[0].downloaded === true) {
				callback('dupe');
			} else if (docs[0].downloaded === false) {
				callback();
			}
		} else {
			Raven.context(() => {
				Raven.captureBreadcrumb({
					data: {
						torrent
					}
				});
				db.insert({
					_id: torrent.link,
					magnet: torrent.link,
					title: torrent.title,
					tvdbID: torrent['tv:show_name']['#'],
					airdate: torrent['rss:pubdate']['#'],
					downloaded: false
				});
				callback();
			});
		}
github bfirsh / jsnes-web / src / index.js View on Github external
import Raven from "raven-js";
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import config from "./config";
import "./index.scss";

if (config.SENTRY_URI) {
  Raven.config(config.SENTRY_URI).install();
}

Raven.context(function() {
  ReactDOM.render(, document.getElementById("root"));
});
github night / BetterTTV / src / utils / safe-event-emitter.js View on Github external
function newListener(listener, ...args) {
    try {
        Raven.context(() => listener(...args));
    } catch (e) {
        const debug = require('./debug');
        debug.error('Failed executing listener callback', e.stack);
    }
}
github captbaritone / webamp / js / index.js View on Github external
return new Promise((resolve, reject) => {
    if (window.Dropbox == null) {
      reject();
    }
    window.Dropbox.choose({
      success: resolve,
      error: reject,
      linkType: "direct",
      folderselect: false,
      multiselect: true,
      extensions: ["video", "audio"]
    });
  });
}

Raven.context(() => {
  if (hideAbout) {
    document.getElementsByClassName("about")[0].style.visibility = "hidden";
  }
  if (!Winamp.browserIsSupported()) {
    document.getElementById("browser-compatibility").style.display = "block";
    document.getElementById("app").style.visibility = "hidden";
    return;
  }

  const winamp = new Winamp({
    initialSkin: {
      url: skinUrl
    },
    initialTracks,
    availableSkins: [
      { url: base, name: "" },