add diff labels and star count
All checks were successful
Deploy SSR / deploy (push) Successful in 1m10s

This commit is contained in:
Lee
2024-09-12 00:20:50 +01:00
parent ea06a282ae
commit aca00aa7c8
4 changed files with 55 additions and 12 deletions

View File

@ -37,7 +37,7 @@ export default class DataFetcher {
* @param url the url to fetch
* @returns the fetched data
*/
public async fetch<T>(useProxy: boolean, url: string): Promise<T> {
public async fetch<T>(useProxy: boolean, url: string): Promise<T | undefined> {
try {
return await ky
.get<T>(this.buildRequestUrl(useProxy, url), {
@ -47,8 +47,8 @@ export default class DataFetcher {
})
.json();
} catch (error) {
console.error(error);
throw error;
console.error(`Error fetching data from ${url}:`, error);
return undefined;
}
}
}