Skip to content

Consistent TypeErrors #14614

@sonicdoe

Description

@sonicdoe
fs.readFileSync(null)
// > TypeError: path must be a string or Buffer

path.join(null)
// > TypeError: Path must be a string. Received null

new URL(null)
// > TypeError [ERR_INVALID_URL]: Invalid URL: null

The above output is from Node.js v8.2.1. I think It would be nice if TypeErrors in general would be more consistent across Node.js’s core modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originated in Node.js core.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