Wrap note fetching in a try/catch
This commit is contained in:
parent
f0dc329296
commit
45ef53994c
1 changed files with 23 additions and 20 deletions
|
@ -399,8 +399,10 @@ router.get("/notes/:note", async (ctx, next) => {
|
||||||
visibility: In(["public", "home"]),
|
visibility: In(["public", "home"]),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
if (note) {
|
if (note) {
|
||||||
const _note = await Notes.pack(note);
|
const _note = await Notes.pack(note);
|
||||||
|
|
||||||
const profile = await UserProfiles.findOneByOrFail({ userId: note.userId });
|
const profile = await UserProfiles.findOneByOrFail({ userId: note.userId });
|
||||||
const meta = await fetchMeta();
|
const meta = await fetchMeta();
|
||||||
await ctx.render("note", {
|
await ctx.render("note", {
|
||||||
|
@ -421,6 +423,7 @@ router.get("/notes/:note", async (ctx, next) => {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} catch {}
|
||||||
|
|
||||||
await next();
|
await next();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue