Skip to content

fs.unlink throw exception if path is not definedΒ #6524

@armandciejak

Description

@armandciejak

When calling fs.unlink with path argument undefined the function throw an exception. I expect the function to return all errors with the callback as documented.

Here is how to reproduce the problem using the REPL:

> var fs = require('fs');
> var p;
> fs.unlink(p, function(error) {console.log('Async error: ' + error.message);});
TypeError: path must be a string
    at TypeError (native)
    at Object.fs.unlink (fs.js:927:11)
    at repl:1:4
    at REPLServer.defaultEval (repl.js:262:27)
    at bound (domain.js:287:14)
    at REPLServer.runBound [as eval] (domain.js:300:12)
    at REPLServer.<anonymous> (repl.js:431:12)
    at emitOne (events.js:82:20)
    at REPLServer.emit (events.js:169:7)
    at REPLServer.Interface._onLine (readline.js:211:10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions