Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up the use of "callback" vs "cb"

  • Loading branch information...
commit f839b93fbac5a4688933ad02ca63b7e7093f79c6 1 parent f3ae631
@mattrobenolt mattrobenolt authored
Showing with 14 additions and 14 deletions.
  1. +9 −9 lib/client.js
  2. +5 −5 lib/utils.js
View
18 lib/client.js
@@ -53,7 +53,7 @@ _.process = function process(kwargs) {
return {'id': event_id, 'checksum': checksum};
};
-_.sendRemote = function sendRemote(message, headers, callback) {
+_.sendRemote = function sendRemote(message, headers, cb) {
var self = this;
var options = {
host: self.dsn.host,
@@ -89,31 +89,31 @@ _.send = function send(kwargs) {
};
_.createFromText =
-_.create_from_text = function createFromText(message, kwargs, callback) {
- if(!callback && typeof kwargs === 'function') {
- callback = kwargs;
+_.create_from_text = function createFromText(message, kwargs, cb) {
+ if(!cb && typeof kwargs === 'function') {
+ cb = kwargs;
kwargs = {};
} else {
kwargs = kwargs || {};
}
var result = this.process(parsers.parseText(message, kwargs));
- callback && callback(result);
+ cb && cb(result);
return result;
};
_.createFromError =
_.create_from_exception =
-_.create_from_error = function createFromError(err, kwargs, callback) {
+_.create_from_error = function createFromError(err, kwargs, cb) {
var self = this;
- if(!callback && typeof kwargs === 'function') {
- callback = kwargs;
+ if(!cb && typeof kwargs === 'function') {
+ cb = kwargs;
kwargs = {};
} else {
kwargs = kwargs || {};
}
parsers.parseError(err, kwargs, function(kw) {
var result = self.process(kw);
- callback && callback(result);
+ cb && cb(result);
});
};
View
10 lib/utils.js
@@ -72,7 +72,7 @@ var LINES_OF_CONTEXT = 7;
* Testing out with a custom stack track.
* (Not done)
*/
-module.exports.parseStackBetter = function parseStackBetter(err, callback) {
+module.exports.parseStackBetter = function parseStackBetter(err, cb) {
var orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(_, stack){ return stack; };
//Error.captureStackTrace(err);
@@ -98,7 +98,7 @@ module.exports.parseStackBetter = function parseStackBetter(err, callback) {
});
};
-module.exports.parseStack = function parseStack(stack, callback) {
+module.exports.parseStack = function parseStack(stack, cb) {
// grab all lines except the first
var lines = stack.split('\n').slice(1), callbacks=lines.length, frames=[], cache={};
@@ -118,7 +118,7 @@ module.exports.parseStack = function parseStack(stack, callback) {
// check if it has been read in first
if(frame.filename in cache) {
parseLines(cache[frame.filename]);
- if(--callbacks === 0) callback(null, frames);
+ if(--callbacks === 0) cb(null, frames);
} else {
fs.readFile(frame.filename, function(err, file) {
if(!err) {
@@ -127,12 +127,12 @@ module.exports.parseStack = function parseStack(stack, callback) {
parseLines(file);
}
frames[index] = frame;
- if(--callbacks === 0) callback(null, frames);
+ if(--callbacks === 0) cb(null, frames);
});
}
} else {
frames[index] = frame;
- if(--callbacks === 0) callback(null, frames);
+ if(--callbacks === 0) cb(null, frames);
}
function parseLines(lines) {
Please sign in to comment.
Something went wrong with that request. Please try again.