patrickjuchli / basic-ftp

FTP client for Node.js, supports FTPS over TLS, passive mode over IPv6, async/await, and Typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ensureDir should throw on Access Denied during MKD

vicary opened this issue · comments

Describe the bug
Currently running ensureDir I only receive a 550 The system cannot find the file specified. which from the CMD, but when running MKD it is already receiving a 550 Access is Denied. Throwing access denied is much more concise and self explanatory about the actual situation than a file not found error.

Example code

await client.ensureDir("a/b/c/d/e");

Console output

> MKD a
< 550 Access is denied.
> CMD a
< 550 The system cannot find the file specified.

Which version of Node.js are you using?
Node v16.17.1

Additional context
The FTP server is a Microsoft File Server, and is believed to be missing my permission to create folders.

A correct error message would definitely save me an hour of debugging.