Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception on write #2

Open
opravil-jan opened this issue May 11, 2017 · 0 comments
Open

Unhandled exception on write #2

opravil-jan opened this issue May 11, 2017 · 0 comments

Comments

@opravil-jan
Copy link

On write I check if uploaded file is csv and when it is not I return error. After returning the error I got another error and then my client crashes.

strep to reproduce:
Put this part of code to your code and try upload file without csv extension.

session.on("write", (pathName, offset, cb) => {
      if (!pathName.endsWith(".csv")) {
        return cb(new Error("You must upload csv."));
      }
      console.log(pathName)
}

We moved try on https://github.com/kamicane/simple-ftpd/blob/master/lib/requests/stor.js#L39
to line 35 and looks like it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant