mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
chore: improve error messages
This commit is contained in:
@@ -24,6 +24,10 @@ export async function connect() {
|
||||
|
||||
export async function getRepository(repoId: string) {
|
||||
const data = await AnonymizedRepositoryModel.findOne({ repoId });
|
||||
if (!data) throw new AnonymousError("repo_not_found", repoId);
|
||||
if (!data)
|
||||
throw new AnonymousError("repo_not_found", {
|
||||
object: repoId,
|
||||
httpStatus: 400,
|
||||
});
|
||||
return new Repository(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user