code: function(err){
    //if this is already a network error just throw it
    if(err instanceof NetworkError){
      throw err
    }
    //convert strings to errors
    if('string' === typeof err){
      err = new Error(err)
    }
    //check if the error message matches a known TCP error
    var error
    for(var i = 0; i < tcpErrors.length; i++){
      if(err.message.indexOf(tcpErrors[i]) >= 0){
        //lets throw a NetworkError
        error = new NetworkError(err.message)
        //preserve the original stack trace so we can actually debug these
        error.stack = err.stack
        throw error
      }
    }
    //if we make it here it is not an error we can handle just throw it
    throw err
  }
docs: Handle network errors
  @param {Error} err