mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
handle error with try catch
This commit is contained in:
@@ -10,10 +10,16 @@ module.exports = (options) => {
|
||||
options.res.send(reply);
|
||||
}
|
||||
else {
|
||||
options.getHTML((html) => {
|
||||
redis.set(options.req.url, html);
|
||||
options.res.send(html);
|
||||
});
|
||||
try {
|
||||
options.getHTML((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