From ddcf71225226bc0929d5c6d609b13ff0489e5b94 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 14 Aug 2021 22:28:17 +0200 Subject: Revamped backend error handling & improved imports in tests --- packages/server/src/git/diff.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/server/src/git/diff.ts') diff --git a/packages/server/src/git/diff.ts b/packages/server/src/git/diff.ts index 3d69183..d084e5d 100644 --- a/packages/server/src/git/diff.ts +++ b/packages/server/src/git/diff.ts @@ -1,5 +1,5 @@ import { Diff as NodeGitDiff } from "nodegit"; -import { createError, DiffError } from "./error"; +import { createError, ErrorWhere, NotFoundError } from "./error"; import { Patch } from "./patch"; type PatchHeaderData = { @@ -75,7 +75,7 @@ export class Diff { const patch = (await this.ng_diff.patches())[index]; if(!patch) { - throw(createError(DiffError, 500, "Patch not found")); + throw(createError(ErrorWhere.Diff, NotFoundError, "Patch")); } return new Patch(this, (await this.ng_diff.patches())[index], index); -- cgit v1.2.3-18-g5258