iarna / filesystem-errorcodes

Which error conditions result in which codes across node supported OSes?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filesystem Errorcodes

process.chdir(dir)

  • dir does not exist
    • ENOENT
  • no permission to chdir to dir
    • EACCES

fs.readdir(dir, cb)

  • dir does not exist
    • ENOENT
  • no permission to read dir
    • EACCES

fs.mkdir(dir, cb)

  • dir does not exist
    • ENOENT
  • no permission to create dir
    • EACCES

fs.rmdir(dir, cb)

  • dir does not exist
    • ENOENT
  • no permission to remove dir
    • EACCES

fs.rename(from, to, cb)

  • from is a directory and to exists (WINDOWS)
    • EPERM
  • from and to are directories and to contains files (NON-WINDOWS)
    • ENOTEMPTY
  • can't write to the parent folder of to (WINDOWS)
    • EPERM
  • can't write to the parent folder of to (NON-WINDOWS)
    • EACCES

Assumptions

Currently these tests assume that sync and async functions will produce the same error objects. If this proves ever to not be true we'll split out the tests.

About

Which error conditions result in which codes across node supported OSes?

License:ISC License


Languages

Language:JavaScript 100.0%