Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

no default for maxBusyTries #7

Closed
mvolkmann opened this Issue Oct 7, 2011 · 4 comments

Comments

Projects
None yet
2 participants

If I don't pass the maxBusyTries option, I get:
uncaught: TypeError: Cannot read property 'maxBusyTries' of undefined

Owner

isaacs commented Oct 7, 2011

Please share your code. There is a default for maxBusyTries, it's 3. If you pass an opts object, then it must be an object.

@isaacs isaacs closed this Oct 7, 2011

Owner

isaacs commented Oct 7, 2011

Relevant code:

function rimraf (p, opts, cb) {
  if (typeof opts === "function") cb = opts, opts = {}

  var busyTries = 0
  opts.maxBusyTries = opts.maxBusyTries || 3

I see what's happening now. If you forget to pass a callback function, the error you get is what I reported. Maybe the code should check whether a callback was omitted and produce a different error message for that case.

Owner

isaacs commented Oct 7, 2011

I see. Good point.

@isaacs isaacs reopened this Oct 7, 2011

@isaacs isaacs closed this in 4af3afe Oct 7, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment