mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-16 06:49:09 +02:00
improve logging
This commit is contained in:
@@ -34,7 +34,7 @@ router.get(
|
||||
if (!(await repo.isReady())) {
|
||||
throw new AnonymousError("repository_not_ready", {
|
||||
object: repo,
|
||||
httpStatus: 503,
|
||||
httpStatus: 425,
|
||||
});
|
||||
}
|
||||
const f = new AnonymizedFile({
|
||||
|
||||
@@ -59,7 +59,7 @@ router.get(
|
||||
);
|
||||
}
|
||||
throw new AnonymousError("gist_not_ready", {
|
||||
httpStatus: 404,
|
||||
httpStatus: 425,
|
||||
object: gist,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ router.get(
|
||||
);
|
||||
}
|
||||
throw new AnonymousError("repository_not_ready", {
|
||||
httpStatus: 404,
|
||||
httpStatus: 425,
|
||||
object: repo,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ export function isOwnerCoauthorOrAdmin(repo: Repository, user: User) {
|
||||
if (repo.owner.id === user.model.id) return;
|
||||
if (isCoauthor(repo, user)) return;
|
||||
throw new AnonymousError("not_authorized", {
|
||||
httpStatus: 401,
|
||||
httpStatus: 403,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user