forked from MapComplete/MapComplete
Improve scraping server
This commit is contained in:
parent
bf523848fb
commit
5759d4f8a7
2 changed files with 20 additions and 7 deletions
|
@ -91,6 +91,12 @@ export class Server {
|
|||
|
||||
try {
|
||||
const result = await handler.handle(path, url.searchParams)
|
||||
if(result === undefined){
|
||||
res.writeHead(500)
|
||||
res.write("Could not fetch this website, probably blocked by them")
|
||||
res.end()
|
||||
return
|
||||
}
|
||||
if (typeof result !== "string") {
|
||||
console.error(
|
||||
"Internal server error: handling",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue