From e8efe321266da074e65ce9d10ffdb52c1733a517 Mon Sep 17 00:00:00 2001 From: Paul <44974737+paulober@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:33:45 +0200 Subject: [PATCH] fix: add errors to typescript declarations (#337) fixes #336 --- ftp-srv.d.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ftp-srv.d.ts b/ftp-srv.d.ts index b14b113..4b3231f 100644 --- a/ftp-srv.d.ts +++ b/ftp-srv.d.ts @@ -41,6 +41,38 @@ export class FileSystem { getUniqueName(fileName: string): string; } +export class GeneralError extends Error { + /** + * @param message The error message. + * @param code Default value is `400`. + */ + constructor(message: string, code?: number); +} + +export class SocketError extends Error { + /** + * @param message The error message. + * @param code Default value is `500`. + */ + constructor(message: string, code?: number); +} + +export class FileSystemError extends Error { + /** + * @param message The error message. + * @param code Default value is `400`. + */ + constructor(message: string, code?: number); +} + +export class ConnectorError extends Error { + /** + * @param message The error message. + * @param code Default value is `400`. + */ + constructor(message: string, code?: number); +} + export class FtpConnection extends EventEmitter { server: FtpServer; id: string;