aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/git/error.ts')
-rw-r--r--packages/server/src/git/error.ts8
1 files changed, 8 insertions, 0 deletions
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<T> = 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<E extends BaseError>(ErrorConstructor: ErrorConstructorType<E>, code: number, message: string): E {
return new ErrorConstructor(code, message);
} \ No newline at end of file