aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/blob.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/blob.ts
parent81b39ee7848b0fbdcd8b61a04077a58c23580dd1 (diff)
Revamped backend error handling & improved imports in tests
Diffstat (limited to 'packages/server/src/git/blob.ts')
-rw-r--r--packages/server/src/git/blob.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/git/blob.ts b/packages/server/src/git/blob.ts
index 5d1d892..ad88ca5 100644
--- a/packages/server/src/git/blob.ts
+++ b/packages/server/src/git/blob.ts
@@ -1,4 +1,4 @@
-import { BlobError, createError } from "./error";
+import { createError, ErrorWhere, IsNotError } from "./error";
import { Tree } from "./tree";
import { BlobTreeEntry } from "./tree_entry";
@@ -37,7 +37,7 @@ export class Blob {
const entry = await tree.find(path);
if(!(entry instanceof BlobTreeEntry)) {
- throw(createError(BlobError, 500, "Not a blob"));
+ throw(createError(ErrorWhere.Blob, IsNotError, "tree entry", "a blob"));
}
return new Blob(entry);