Prevent searchless crashing

This commit is contained in:
Bingus_Violet 2024-02-14 10:53:50 -06:00
parent ff496892d7
commit a55036e7d0
3 changed files with 9 additions and 9 deletions

View file

@ -140,10 +140,10 @@ app.get("/search", async (req, res) => {
res.write(addedHTML + html.substring(html.indexOf("{RESULTS}") + 9), () => {res.end()})
})
// process.on('uncaughtException', (err, origin) => {
// fs.writeSync(
// process.stderr.fd,
// `Caught exception: ${err}\n` +
// `Exception origin: ${origin}`,
// );
// });
process.on('uncaughtException', (err, origin) => {
fs.writeSync(
process.stderr.fd,
`Caught exception: ${err}\n` +
`Exception origin: ${origin}`,
);
});

View file

@ -19,7 +19,7 @@
</div>
<div class="col-6">
<form action="/search">
<input type="text" placeholder="Search" name="q">
<input required type="text" placeholder="Search" name="q">
</form>
</div>
</div>

View file

@ -19,7 +19,7 @@
</div>
<div class="col-6">
<form action="/search">
<input type="text" placeholder="Search" name="q" value="{SEARCH}">
<input required type="text" placeholder="Search" name="q" value="{SEARCH}">
</form>
</div>
</div>