diff --git a/index.js b/index.js index 290a4e5..84a7ea4 100755 --- a/index.js +++ b/index.js @@ -71,14 +71,14 @@ app.post('/', function(req, res) { if (!html) { res.status(400).send("Please provide a POST parameter called html"); } else { - //try { + try { let document = new JSDOM(html); let markdown = processor.process_dom(url, document, res, inline_title, ignore_links); send_headers(res); res.send(markdown); - //} catch (error) { - //res.status(400).send("Could not parse that document"); - //} + } catch (error) { + res.status(400).send("Could not parse that document"); + } } }); diff --git a/url_to_markdown_readers.js b/url_to_markdown_readers.js index 80247a2..b06f0e4 100755 --- a/url_to_markdown_readers.js +++ b/url_to_markdown_readers.js @@ -13,8 +13,8 @@ class html_reader { JSDOM.fromURL(url).then((document)=>{ let markdown = processor.process_dom(url, document, res, inline_title, ignore_links); res.send(markdown); - //}).catch((error)=> { - // res.status(400).send(failure_message); + }).catch((error)=> { + res.status(400).send(failure_message); }); } } @@ -47,8 +47,8 @@ class stack_reader { else { res.send(markdown_q + "\n\n## Answer\n"+ markdown_a); } - //}).catch((error)=> { - // res.status(400).send(failure_message); + }).catch((error)=> { + res.status(400).send(failure_message); }); } }