Render error pages as HTML
This commit is contained in:
@@ -5,14 +5,14 @@ import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
|
||||
import { profileAtomFeed } from "../feeds.ts";
|
||||
import Article from "../models/article.ts";
|
||||
import Profile from "../models/profile.ts";
|
||||
import notFoundHandler from "../handlers/not-found.ts";
|
||||
|
||||
const userAtomFeedHandler = async function (ctx: Context) {
|
||||
const username = ctx.params.user.replace(/^(@|~)/, "");
|
||||
const pubkey = await lookupPubkeyByUsername(username);
|
||||
|
||||
if (!pubkey) {
|
||||
ctx.response.status = 404;
|
||||
ctx.response.body = "Not Found";
|
||||
notFoundHandler(ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,7 @@ const userAtomFeedHandler = async function (ctx: Context) {
|
||||
}
|
||||
} catch (e) {
|
||||
log(e, "yellow");
|
||||
ctx.response.status = 404;
|
||||
ctx.response.body = "Not Found";
|
||||
notFoundHandler(ctx);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user