ITADN

Exceptions are incorrectly specific

#265Openjames-pre 创建于 2025-09-23
J
james-precommented
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 条评论