Comparing version 4.2.0 to 4.3.0
@@ -8,2 +8,5 @@ CHANGELOG | ||
## 4.3.0 (2016-9-30) | ||
* @ggoodman Allow socket errors to be handled with errorHandler | ||
## 4.2.0 (2016-8-3) | ||
@@ -10,0 +13,0 @@ * @mhahn Add support for DataDog service checks |
@@ -75,2 +75,6 @@ "use strict"; | ||
} | ||
if (!options.isChild && options.errorHandler) { | ||
this.socket.on('error', options.errorHandler); | ||
} | ||
@@ -77,0 +81,0 @@ if(options.globalize){ |
{ | ||
"name": "hot-shots", | ||
"description": "Node.js client for StatsD, DogStatsD, and Telegraf", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"author": "Steve Ivy", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -167,5 +167,15 @@ # hot-shots | ||
In the event that there is a socket error, `hot-shots` will allow this error to bubble up. If you would like to catch the errors, just attach a listener to the socket property on the instance. | ||
In the event that there is a socket error, `hot-shots` will allow this error to bubble up unless an `errorHandler` is specified. If you would like to catch the errors, either specify an `errorHandler` in your root client or just attach a listener to the socket property on the instance. | ||
```javascript | ||
// Using errorHandler | ||
var client = new StatsD({ | ||
errorHandler: function (error) { | ||
console.log("Socket errors caught here: ", error); | ||
} | ||
}) | ||
``` | ||
```javascript | ||
// Attaching an error handler to client's socket | ||
client.socket.on('error', function(error) { | ||
@@ -172,0 +182,0 @@ console.error("Error in socket: ", error); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33824
569
208