diff options
author | HampusM <hampus@hampusmat.com> | 2021-08-14 22:28:17 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-08-14 22:28:17 +0200 |
commit | ddcf71225226bc0929d5c6d609b13ff0489e5b94 (patch) | |
tree | 7f788d29af4441e27d709aaec1359e205871a11b /packages/server/src/git/blob.ts | |
parent | 81b39ee7848b0fbdcd8b61a04077a58c23580dd1 (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.ts | 4 |
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); |