mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 15:47:48 +08:00
handle error with try catch
This commit is contained in:
@@ -10,10 +10,16 @@ module.exports = (options) => {
|
|||||||
options.res.send(reply);
|
options.res.send(reply);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
options.getHTML((html) => {
|
try {
|
||||||
redis.set(options.req.url, html);
|
options.getHTML((html) => {
|
||||||
options.res.send(html);
|
redis.set(options.req.url, html);
|
||||||
});
|
options.res.send(html);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
redis.set(options.req.url, '');
|
||||||
|
options.res.send('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user