diff --git a/index.js b/index.js index 4cc82d0..5354f54 100644 --- a/index.js +++ b/index.js @@ -6,9 +6,9 @@ var DataDog = function(apiKey, applicationKey, opt_apiBaseUrl) { } this.apiBaseUrl = opt_apiBaseUrl; - this.apiKey = apiKey; this.applicationKey = applicationKey; + }; DataDog.prototype.postEvent = function(event, callback) { @@ -20,9 +20,9 @@ DataDog.prototype.postEvent = function(event, callback) { }, json: event }, - callback); -}; - + callback).on('error', function(e) { + console.log(e.message); +}); DataDog.prototype.postSeries = function(series, callback) { request.post({ @@ -33,9 +33,9 @@ DataDog.prototype.postSeries = function(series, callback) { }, json: series }, - callback); -}; - + callback).on('error', function(e) { + console.log(e.message); +}); DataDog.prototype.search = function(queryString, callback) { request.get({ @@ -45,8 +45,8 @@ DataDog.prototype.search = function(queryString, callback) { application_key: this.applicationKey } }, - callback); -}; - + callback).on('error', function(e) { + console.log(e.message); +}); module.exports = DataDog;