Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Workaround for seeming Node 0.6 errno bug.

  • Loading branch information...
commit 11dd1b0185e9184dca1563aeec38feece568f5f3 1 parent fd05734
@aseemk aseemk authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/util._coffee
View
8 lib/util._coffee
@@ -1,4 +1,3 @@
-constants = require 'constants'
request = require 'request'
URL = require 'url'
@@ -82,8 +81,11 @@ exports.adjustError = (error) ->
if typeof error isnt 'object'
error = new Error error
- if error.errno is constants.ECONNREFUSED
- error.message = "Couldn’t reach database (Connection refused)"
+ # XXX Node 0.6 seems to break error.errno -- doesn't match constants
+ # anymore -- so don't use it! instead, use the string code directly.
+ # see: http://stackoverflow.com/a/9254101/132978
+ if error.code is 'ECONNREFUSED'
+ error.message = "Couldn’t reach database (connection refused)"
return error
Please sign in to comment.
Something went wrong with that request. Please try again.