QuorumDMS/ftp-srv

type declaration for errors are wrong

Opened this issue · 1 comments

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.

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.