mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 22:37:56 +01:00
add try catch :p
This commit is contained in:
parent
c7982f2d10
commit
5ca91af393
1 changed files with 35 additions and 31 deletions
|
@ -79,6 +79,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query) {
|
if (query) {
|
||||||
|
try {
|
||||||
const search = await modules.fetch(
|
const search = await modules.fetch(
|
||||||
`https://tube-srv.ashley143.gay/api/search?query=${query.replace(
|
`https://tube-srv.ashley143.gay/api/search?query=${query.replace(
|
||||||
"&",
|
"&",
|
||||||
|
@ -112,6 +113,9 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
q: query,
|
q: query,
|
||||||
summary,
|
summary,
|
||||||
});
|
});
|
||||||
|
} catch {
|
||||||
|
res.redirect("/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue