aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/diff.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-08-14 22:28:17 +0200
committerHampusM <hampus@hampusmat.com>2021-08-14 22:28:17 +0200
commitddcf71225226bc0929d5c6d609b13ff0489e5b94 (patch)
tree7f788d29af4441e27d709aaec1359e205871a11b /packages/server/src/git/diff.ts
parent81b39ee7848b0fbdcd8b61a04077a58c23580dd1 (diff)
Revamped backend error handling & improved imports in tests
Diffstat (limited to 'packages/server/src/git/diff.ts')
-rw-r--r--packages/server/src/git/diff.ts4
1 files changed, 2 insertions, 2 deletions
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);