Skip to content

Commit acf7eab

Browse files
committed
Expose POSIX error name as PosixError.code
This matches the behaviour of Node.JS's errors, and some libraries expect it.
1 parent 017077f commit acf7eab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/puter-js-common/src/PosixError.js

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class PosixError extends Error {
8989

9090
super(message ?? ErrorMetadata.get(posixCode).description);
9191
this.posixCode = posixCode;
92+
this.code = posixCode.description;
9293
}
9394

9495
static fromNodeJSError(e) {

0 commit comments

Comments
 (0)