From 7fabb02bfe5672380f3ebdfea7b3bd5c32a54149 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 22 Jul 2021 20:23:02 +0200 Subject: Improved error handling in some misc functions --- packages/server/src/git/error.ts | 6 ++++++ 1 file changed, 6 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 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 = new (code: number, message: string) => T; export function createError(ErrorConstructor: ErrorConstructorType, code: number, message: string): E { -- cgit v1.2.3-18-g5258