Skip to content

Commit 5df3efe

Browse files
committed
fix(cp): add invalid type error
1 parent 4eaaa8d commit 5df3efe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/errors.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,11 @@ E('ERR_FS_CP_SOCKET', 'Cannot copy a socket file')
105105
E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self')
106106
E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type')
107107
E('ERR_FS_EISDIR', 'Path is a directory')
108+
109+
module.exports.ERR_INVALID_ARG_TYPE = class ERR_INVALID_ARG_TYPE extends Error {
110+
constructor(name, expected, actual) {
111+
super()
112+
this.code = 'ERR_INVALID_ARG_TYPE'
113+
this.message = `The ${name} argument must be ${expected}. Received ${typeof actual}`
114+
}
115+
}

0 commit comments

Comments
 (0)