Skip to content

Exceptions are incorrectly specific #265

@james-pre

Description

@james-pre

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):

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions