Skip to content

Commit

Permalink
fix(fs): SubdirectoryMoveError extends Error correctly (#4528)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Mar 27, 2024
1 parent 24a81a3 commit 9254339
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions fs/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class SubdirectoryMoveError extends Error {
super(
`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`,
);
this.name = this.constructor.name;
}
}

Expand Down
2 changes: 1 addition & 1 deletion fs/walk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class WalkError extends Error {
`${cause instanceof Error ? cause.message : cause} for path "${root}"`,
);
this.cause = cause;
this.name = "WalkError";
this.name = this.constructor.name;
this.root = root;
}
}
Expand Down

0 comments on commit 9254339

Please sign in to comment.