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;
fork icon21
star icon45
watch icon32

+ 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
fork icon9
star icon67
watch icon6

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);
fork icon9
star icon55
watch icon0

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,
fork icon43
star icon43
watch icon0

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,
fork icon5
star icon13
watch icon82

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);
fork icon3
star icon13
watch icon4

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'}
});
fork icon12
star icon6
watch icon0

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)();
    });
fork icon3
star icon3
watch icon2

+ 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) {
fork icon3
star icon0
watch icon2

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);
fork icon3
star icon0
watch icon1

+ 9 other calls in file

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) {
fork icon0
star icon3
watch icon3

+ 30 other calls in file

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({
fork icon0
star icon3
watch icon3

+ 25 other calls in file

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');
fork icon0
star icon2
watch icon2

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));
```
fork icon2
star icon2
watch icon4

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) {
fork icon243
star icon0
watch icon0

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;

fork icon0
star icon3
watch icon0