How to use the Client function from raven
Find comprehensive JavaScript raven.Client code examples handpicked from public code repositorys.
7 8 9 10 11 12 13 14 15
const log = require('../support/log'); raven.config(); raven.disableConsoleAlerts(); const globalSentryDSNClient = new raven.Client(); const cache = {}; ravenHTTPSTransport.agent = https.globalAgent;
21
45
32
+ 3 other calls in file
213 214 215 216 217 218 219 220 221 222
INSTALLED_APPS = ( 'raven.contrib.django.raven_compat', ) // node var raven = require('raven'); var client = new raven.Client('{{ SENTRY_DSN }}'); client.patchGlobal(); ``` ```notes
9
67
6
GitHub: uber/sentry-logger
50 51 52 53 54 55 56 57 58 59
if (!this.dsn && !options.ravenClient) { throw new Error('Cannot construct a Sentry transport without a DSN'); } this.ravenClient = options.ravenClient || new raven.Client(this.enabled && this.dsn); this.ravenClient.loggerName = 'SentryLogger'; // Unsure how statsd could integrate with this due to ubiquity of the logger // and no initialization function for winston transports this.ravenClient.on('error', ravenErrorHandler);
9
55
0
85 86 87 88 89 90 91 92 93 94
app.middleware(pipelineMiddleware.start); // Sentry middleware if (functions.config().sentry) { app.middleware((conv) => { conv.raven = Raven.Client( functions.config().sentry.url, { sendTimeout: 10, captureUnhandledRejections: true, release: packageJSON.version,
43
43
0
58 59 60 61 62 63 64 65 66 67
let ravenClient; if(isProduction) { assertEnv(['SENTRY_DSN']); ravenClient = new raven.Client(process.env.SENTRY_DSN, { release: pkg.version, name: process.env.HEROKU_APP_NAME || os.hostname(), extra: { env: process.env,
5
13
82
17 18 19 20 21 22 23 24 25 26
}); }; }; exports.sentry = function (sentryConfig, params) { var sentryClient = new raven.Client(sentryConfig.serverDSN, params); return function sentryLogger(err, req) { // https://github.com/getsentry/raven-node/blob/0.12.0/lib/middleware/connect.js#L21-L25 var kwargs = req ? ravenParsers.parseRequest(req) : {}; sentryClient.captureError(err, kwargs);
3
13
4
GitHub: mryraghi/snowdays
6 7 8 9 10 11 12 13 14 15 16 17
const fs = Npm.require('fs'); const CryptoJS = require("crypto-js"); let raven = require('raven'); let client = new raven.Client('https://7b01834070004a4a91b5a7ed14c0b411:79de4d1bd9f24d1a93b78b18750afb54@sentry.io/126769', { environment: Meteor.settings.public.environment, server_name: 'snowdays', tags: {section: 'API'} });
12
6
0
8 9 10 11 12 13 14 15 16 17
ctx_cpy.breadcrumbs = brdc; return ctx_cpy; }; exports.withRavenImpl = function(dsn, options, ctx, act) { var raven = new Raven.Client(dsn, options); var ctx_cpy = exports.setContextHelper(raven,ctx); return raven.context(ctx_cpy, function(){ return act(raven)(); });
3
3
2
+ 9 other calls in file
71 72 73 74 75 76 77 78 79 80
layout = layouts.layout(config.layout.type, config.layout); } var options = { release: config.release }; var client = new raven.Client(config.dsn, options); return sentryAppender(client, layout, config.level) } function simpleLayout(loggingEvent) {
3
0
2
17 18 19 20 21 22 23 24 25 26
exports.getContextImpl = function(raven){ return raven.getContext(); }; exports.ravenImpl = function(dsn) { return new Raven.Client(dsn); }; exports.captureMessageImpl = function(raven, msg) { raven.captureMessage(msg);
3
0
1
+ 9 other calls in file
GitHub: news-ai/social
21 22 23 24 25 26 27 28 29 30 31 32
var topicName = 'process-rss-feed'; var subscriptionName = 'node-rss'; var pubsub = gcloud.pubsub(); // Instantiate a sentry client var sentryClient = new raven.Client('https://4db5dd699d4a4267ab6f56fa97a9ee5c:9240e5b57b864de58f514b6d40e7e5a7@sentry.io/103131'); sentryClient.patchGlobal(); // Get a Google Cloud topic function getTopic(cb) {
0
3
3
+ 30 other calls in file
GitHub: news-ai/social
11 12 13 14 15 16 17 18 19 20 21 22
var topicName = 'process-twitter-feed'; var subscriptionName = 'node-new-user-twitter'; var pubsub = gcloud.pubsub(); // Instantiate a sentry client var sentryClient = new raven.Client('https://9fd2d37a95dc472496b018dd15be1369:195a98802d4f4440852aea96ebb65d2b@sentry.io/103128'); sentryClient.patchGlobal(); // Instantiate a twitter client var twitterClient = new Twitter({
0
3
3
+ 25 other calls in file
GitHub: jaredallard/chat-bridge
48 49 50 51 52 53 54 55 56 57
pipeline = require('./pipeline.js'); } if(pipeline.sentry.enabled) { debug('sentry', 'enabled') let client = new raven.Client(pipeline.sentry.DSN); client.patchGlobal(); } debug('pipeline', 'has', pipeline.pipeline.length, 'pipes');
0
2
2
28 29 30 31 32 33 34 35 36
```js const JasmineSentryReporter = require('jasmine-sentry-reporter'); const raven = require('raven'); const ravenClient = new raven.Client(process.env.SENTRY_DSN); jasmine.getEnv().addReporter(new JasmineSentryReporter(ravenClient)); ```
2
2
4
GitHub: xiongwilee/Gracejs
41 42 43 44 45 46 47 48 49 50
config = config || {}; options = options || {}; let ravenClient; if (options.dsn) { ravenClient = new raven.Client(options.dsn); delete options.dsn; } return async function(ctx, next) {
243
0
0
GitHub: news-ai/social
13 14 15 16 17 18 19 20 21 22 23 24
// log: 'trace', rejectUnauthorized: false }); // Instantiate a sentry client var sentryClient = new raven.Client('https://01a37de7973341628dc29671ba8b7933:382639f851304ae98f55960f242e192b@sentry.io/107549'); sentryClient.patchGlobal(); var instagram = exports;
0
3
0
raven.captureException is the most popular function in raven (228 examples)