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

type declaration for errors are wrong #370

Open
Louis-Tian opened this issue Feb 28, 2024 · 1 comment
Open

type declaration for errors are wrong #370

Louis-Tian opened this issue Feb 28, 2024 · 1 comment

Comments

@Louis-Tian
Copy link

The errors are exposed in the declaration file at top level.

export class GeneralError extends Error {

But they are actually exported under the ftpErrors.

module.exports.ftpErrors = errors;

Should wrap the errors in the type definition inside a namespace to match the code.

@martijnimhoff
Copy link

Currently this can be used as a workaround:

import { ftpErrors } from 'ftp-srv';
new ftpErrors.GeneralError('Invalid username or password', 401)

Be sure to surpress type and lint errors.

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

2 participants