server: provide readable error when a file requested by the client file is not found
This commit is contained in:
parent
8381ca7531
commit
4b250fc389
2 changed files with 10 additions and 5 deletions
|
|
@ -99,7 +99,11 @@ function httpRoute(req, res) {
|
|||
res.sendFile(path.resolve(sessionPath + url))
|
||||
} catch(e) {
|
||||
// absolute resolution
|
||||
res.sendFile(path.resolve(url))
|
||||
try {
|
||||
res.sendFile(path.resolve(url))
|
||||
} catch(e) {
|
||||
console.error(`(ERROR, HTTP) File not found: ${url}`)
|
||||
}
|
||||
}
|
||||
} else if (url.includes('/osc-ping')) {
|
||||
httpCheck(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue