catch errors
parent
0ab94c807e
commit
9290e3c853
6
index.js
6
index.js
|
@ -44,14 +44,14 @@ app.post('/', function(req, res) {
|
||||||
if (!html) {
|
if (!html) {
|
||||||
res.status(400).send("Please provide a POST parameter called html");
|
res.status(400).send("Please provide a POST parameter called html");
|
||||||
} else {
|
} else {
|
||||||
//try {
|
try {
|
||||||
let document = new JSDOM(html);
|
let document = new JSDOM(html);
|
||||||
let markdown = process_dom(url, document, res);
|
let markdown = process_dom(url, document, res);
|
||||||
send_headers(res);
|
send_headers(res);
|
||||||
res.send(markdown);
|
res.send(markdown);
|
||||||
/*} catch (error) {
|
} catch (error) {
|
||||||
res.status(400).send("Could not parse that document");
|
res.status(400).send("Could not parse that document");
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue