From 09ff261f156a8599d45c1496fe246ded6e035191 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 26 Jul 2021 23:56:53 +0200 Subject: Added backend TSDoc/JSDoc comments & refactored a tiny bit --- packages/server/src/git/error.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packages/server/src/git/error.ts') diff --git a/packages/server/src/git/error.ts b/packages/server/src/git/error.ts index a07d349..fff16a4 100644 --- a/packages/server/src/git/error.ts +++ b/packages/server/src/git/error.ts @@ -50,6 +50,14 @@ export class MiscError extends BaseError { type ErrorConstructorType = new (code: number, message: string) => T; +/** + * An error factory + * + * @param ErrorConstructor - The constructor for what error to create + * @param code - A HTTP code + * @param message - A error message + * @returns An instance of a error + */ export function createError(ErrorConstructor: ErrorConstructorType, code: number, message: string): E { return new ErrorConstructor(code, message); } \ No newline at end of file -- cgit v1.2.3-18-g5258