[Server] Improve: Better error handling

This commit is contained in:
syuilo 2017-01-07 20:37:12 +09:00
parent e053b77d7e
commit 9e743b8356

View file

@ -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));
});
};