mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
[Server] Improve: Better error handling
This commit is contained in:
parent
e053b77d7e
commit
9e743b8356
@ -7,10 +7,9 @@ module.exports = (req: express.Request, res: express.Response) => {
|
|||||||
|
|
||||||
request(url, (err, response, xml) => {
|
request(url, (err, response, xml) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
res.sendStatus(500);
|
||||||
return;
|
} else {
|
||||||
|
res.send(xml2json.toJson(xml));
|
||||||
}
|
}
|
||||||
|
|
||||||
res.send(xml2json.toJson(xml));
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user