aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/misc.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/git/misc.ts')
-rw-r--r--packages/server/src/git/misc.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/server/src/git/misc.ts b/packages/server/src/git/misc.ts
index 1fda304..43c7a70 100644
--- a/packages/server/src/git/misc.ts
+++ b/packages/server/src/git/misc.ts
@@ -1,5 +1,5 @@
import { readFile, readdir } from "fs";
-import { createError, MiscError } from "./error";
+import { createError, ErrorWhere, FailedError } from "./error";
/**
* Asynchronously find an item in an array that matches the requirements set by the callback
@@ -25,7 +25,7 @@ export function getFile(git_dir: string, repository: string, file: string): Prom
return new Promise((resolve, reject) => {
readFile(`${git_dir}/${repository}/${file}`, (err, content) => {
if(err) {
- reject(createError(MiscError, 500, "Failed to open repository file " + file));
+ reject(createError(ErrorWhere.Misc, FailedError, `open repository file '${file}'`));
return;
}
@@ -44,7 +44,7 @@ export function getDirectory(directory: string): Promise<string[]> {
return new Promise<string[]>((resolve, reject) => {
readdir(directory, (err, dir_content) => {
if(err) {
- reject(createError(MiscError, 500, "Failed to open directory " + directory));
+ reject(createError(ErrorWhere.Misc, FailedError, `open directory '${directory}'`));
return;
}