Exceptions are incorrectly specific
Many times when a function throws an exception, the exception's `syscall` and `path` are set to values passed to a failing function call. For example (simplified):
```js
function mkdir(path) {
try {
const parent = stat(parentPath)
} catch {
throw ExceptionWith('stat', parentPath)
}
}
```
The problem is that POSIX platforms don't do this. if you `mkdir` x/y/z and y doesn't exist, the error is `ENOENT: mkdir x/y/z` not `ENOENT: stat x/y`. This needs to be fixed.
0 条评论