aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/routes/repo.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/server/src/routes/repo.ts')
-rw-r--r--packages/server/src/routes/repo.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/server/src/routes/repo.ts b/packages/server/src/routes/repo.ts
index 43d89d2..32ac9c4 100644
--- a/packages/server/src/routes/repo.ts
+++ b/packages/server/src/routes/repo.ts
@@ -3,7 +3,7 @@ import { CoolFastifyRequest, Route } from "../types/fastify";
import { Tag } from "../git/tag";
import { FastifyInstance, FastifyPluginOptions } from "fastify";
import { verifyRepoName } from "../routes/api/util";
-import { BaseError } from "../git/error";
+import { ServerError } from "../git/error";
export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, done: (err?: Error) => void): void {
fastify.addHook("onRequest", async(req: CoolFastifyRequest, reply) => {
@@ -62,16 +62,16 @@ export default function(fastify: FastifyInstance, opts: FastifyPluginOptions, do
method: "GET",
url: "/refs/tags/:tag",
handler: async(req, reply) => {
- const repository = await Repository.open(opts.config.settings.git_dir, req.params.repo).catch((err: BaseError) => err);
+ const repository = await Repository.open(opts.config.settings.git_dir, req.params.repo).catch((err: ServerError) => err);
- if(repository instanceof BaseError) {
+ if(repository instanceof ServerError) {
reply.code(repository.code).send(repository.message);
return;
}
- const tag = await Tag.lookup(repository, req.params.tag).catch((err: BaseError) => err);
+ const tag = await Tag.lookup(repository, req.params.tag).catch((err: ServerError) => err);
- if(tag instanceof BaseError) {
+ if(tag instanceof ServerError) {
reply.code(tag.code).send(tag.message);
return;
}