mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 22:21:30 +00:00
fix(update): Catch errors when fetching GitHub API
This commit is contained in:
1 parent
ec53b3282d
commit
31d971837d
1 file changed
+4
@@ -2,6 +2,7 @@ import fetch from 'node-fetch';
|
||||
import { resourceName } from '../config';
|
||||
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const response = await fetch(`https://api.github.com/repos/overextended/oxmysql/releases/latest`);
|
||||
|
||||
if (response.status !== 200) return;
|
||||
@@ -27,4 +28,7 @@ setTimeout(async () => {
|
||||
console.log(
|
||||
`^3There is ${updateMessage} available for oxmysql - please update to the latest release (current version: ${currentVersion[0]})\r\n${release.html_url}^0`
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}, 1000);
|
||||
Reference in new issue
Block a user