Expose POSIX error name as PosixError.code

This matches the behaviour of Node.JS's errors, and some libraries
expect it.
This commit is contained in:
Sam Atkins committed 2024-05-20 12:14:22 +01:00
1 parent 017077f8cb
commit acf7eabef9
1 file changed
+1
@@ -89,6 +89,7 @@ class PosixError extends Error {
super(message ?? ErrorMetadata.get(posixCode).description);
this.posixCode = posixCode;
this.code = posixCode.description;
}
static fromNodeJSError(e) {