From b988445f7bf299c017370cee36c0d61bc386b22c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Jan 2017 20:37:12 +0900 Subject: [PATCH] [Server] Improve: Better error handling --- src/web/service/rss-proxy.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/web/service/rss-proxy.ts b/src/web/service/rss-proxy.ts index b2862bdd53..6819427ff8 100644 --- a/src/web/service/rss-proxy.ts +++ b/src/web/service/rss-proxy.ts @@ -7,10 +7,9 @@ module.exports = (req: express.Request, res: express.Response) => { request(url, (err, response, xml) => { if (err) { - console.error(err); - return; + res.sendStatus(500); + } else { + res.send(xml2json.toJson(xml)); } - - res.send(xml2json.toJson(xml)); }); };