add try catch :p

This commit is contained in:
Ashley 2022-12-31 12:39:51 +00:00
parent 1aae2b4973
commit da5daddf49

View file

@ -79,6 +79,7 @@ module.exports = function (app, config, renderTemplate) {
}
if (query) {
try {
const search = await modules.fetch(
`https://tube-srv.ashley143.gay/api/search?query=${query.replace(
"&",
@ -112,6 +113,9 @@ module.exports = function (app, config, renderTemplate) {
q: query,
summary,
});
} catch {
res.redirect("/");
}
}
});