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/blob.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/server/src/git/blob.ts') 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); -- cgit v1.2.3-18-g5258