Permalink
Browse files

error handling - maybe you've heard of it, etsy?

  • Loading branch information...
1 parent 3bf3786 commit 4b4adb4014bda5e3e67c292dee1c8d47b7a60e8e @iamcal iamcal committed with kastner Apr 29, 2011
Showing with 9 additions and 6 deletions.
  1. +9 −6 stats.js
View
@@ -119,12 +119,15 @@ config.configFile(process.argv[2], function (config, oldConfig) {
statString += 'statsd.numStats ' + numStats + ' ' + ts + "\n";
- var graphite = net.createConnection(config.graphitePort, config.graphiteHost);
-
- graphite.on('connect', function() {
- this.write(statString);
- this.end();
- });
+ try {
+ var graphite = net.createConnection(config.graphitePort, config.graphiteHost);
+ graphite.on('connect', function() {
+ this.write(statString);
+ this.end();
+ });
+ } catch(e){
+ // no big deal
+ }
}, flushInterval);
}

0 comments on commit 4b4adb4

Please sign in to comment.