@@ -6,12 +6,12 @@ var zlib = require('zlib');
66var utils = require ( './utils' ) ;
77var uuid = require ( 'node-uuid' ) ;
88var transports = require ( './transports' ) ;
9- var node_util = require ( 'util' ) ; // node_util to avoid confusion with "utils"
9+ var nodeUtil = require ( 'util' ) ; // nodeUtil to avoid confusion with "utils"
1010var events = require ( 'events' ) ;
1111
1212module . exports . version = require ( '../package.json' ) . version ;
1313
14- var extend = Object . assign || function ( target ) {
14+ var extend = Object . assign || function ( target ) {
1515 for ( var i = 1 ; i < arguments . length ; i ++ ) {
1616 var source = arguments [ i ] ;
1717 for ( var key in source ) {
@@ -63,9 +63,9 @@ var Client = function Client(dsn, options) {
6363 globalContext . extra = options . extra ;
6464 }
6565
66- this . on ( 'error' , function ( e ) { } ) ; // noop
66+ this . on ( 'error' , function ( e ) { } ) ; // noop
6767} ;
68- node_util . inherits ( Client , events . EventEmitter ) ;
68+ nodeUtil . inherits ( Client , events . EventEmitter ) ;
6969var proto = Client . prototype ;
7070
7171module . exports . Client = Client ;
@@ -110,25 +110,25 @@ proto.process = function process(kwargs) {
110110 kwargs = this . dataCallback ( kwargs ) ;
111111 }
112112
113- // this will happen asynchronously. We don't care about it's response.
113+ // this will happen asynchronously. We don't care about its response.
114114 this . _enabled && this . send ( kwargs , ident ) ;
115115
116116 return ident ;
117117} ;
118118
119119proto . send = function send ( kwargs , ident ) {
120120 var self = this ;
121-
121+
122122 var skwargs = stringify ( kwargs ) ;
123123
124- zlib . deflate ( skwargs , function ( err , buff ) {
124+ zlib . deflate ( skwargs , function ( err , buff ) {
125125 var message = buff . toString ( 'base64' ) ,
126- timestamp = new Date ( ) . getTime ( ) ,
127- headers = {
128- 'X-Sentry-Auth' : utils . getAuthHeader ( timestamp , self . dsn . public_key , self . dsn . private_key ) ,
129- 'Content-Type' : 'application/octet-stream' ,
130- 'Content-Length' : message . length
131- } ;
126+ timestamp = new Date ( ) . getTime ( ) ,
127+ headers = {
128+ 'X-Sentry-Auth' : utils . getAuthHeader ( timestamp , self . dsn . public_key , self . dsn . private_key ) ,
129+ 'Content-Type' : 'application/octet-stream' ,
130+ 'Content-Length' : message . length
131+ } ;
132132
133133 self . transport . send ( self , message , headers , ident ) ;
134134 } ) ;
@@ -161,7 +161,7 @@ proto.captureException = function captureError(err, kwargs, cb) {
161161 } else {
162162 kwargs = kwargs || { } ;
163163 }
164- parsers . parseError ( err , kwargs , function ( kw ) {
164+ parsers . parseError ( err , kwargs , function ( kw ) {
165165 var result = self . process ( kw ) ;
166166 cb && cb ( result ) ;
167167 } ) ;
@@ -230,7 +230,7 @@ module.exports.patchGlobal = function patchGlobal(client, cb) {
230230 ! ( client instanceof Client ) && ( client = new Client ( ) ) ;
231231
232232 var called = false ;
233- process . on ( 'uncaughtException' , function ( err ) {
233+ process . on ( 'uncaughtException' , function ( err ) {
234234 if ( cb ) { // bind event listeners only if a callback was supplied
235235 var onLogged = function onLogged ( ) {
236236 called = false ;
@@ -254,8 +254,8 @@ module.exports.patchGlobal = function patchGlobal(client, cb) {
254254
255255 called = true ;
256256
257- client . captureError ( err , function ( result ) {
258- node_util . log ( 'uncaughtException: ' + client . getIdent ( result ) ) ;
257+ return client . captureError ( err , function ( result ) {
258+ nodeUtil . log ( 'uncaughtException: ' + client . getIdent ( result ) ) ;
259259 } ) ;
260260 } ) ;
261261} ;
0 commit comments