Prevent searchless crashing
This commit is contained in:
parent
ff496892d7
commit
a55036e7d0
3 changed files with 9 additions and 9 deletions
14
index.js
14
index.js
|
@ -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}`,
|
||||
);
|
||||
});
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue