aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/error.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-22 20:23:02 +0200
committerHampusM <hampus@hampusmat.com>2021-07-22 20:23:02 +0200
commit7fabb02bfe5672380f3ebdfea7b3bd5c32a54149 (patch)
treeb2df9047f198503f29c1c004a85cc05d96fba9eb /packages/server/src/git/error.ts
parent20eaed44da11a17c8cbaba8742daff95ad329016 (diff)
Improved error handling in some misc functions
Diffstat (limited to 'packages/server/src/git/error.ts')
-rw-r--r--packages/server/src/git/error.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/server/src/git/error.ts b/packages/server/src/git/error.ts
index 0429a6c..a07d349 100644
--- a/packages/server/src/git/error.ts
+++ b/packages/server/src/git/error.ts
@@ -42,6 +42,12 @@ export class BlobError extends BaseError {
}
}
+export class MiscError extends BaseError {
+ constructor(code: number, message: string) {
+ super(code, "A misc error has occured: " + message);
+ }
+}
+
type ErrorConstructorType<T> = new (code: number, message: string) => T;
export function createError<E extends BaseError>(ErrorConstructor: ErrorConstructorType<E>, code: number, message: string): E {