1
0
mirror of https://github.com/NickKaramoff/toot synced 2025-02-07 04:43:34 +01:00

Add a bit better error handling

This commit is contained in:
Nikita Karamov 2023-03-17 23:08:50 +01:00
parent 49a489d532
commit f2ba7d5324
No known key found for this signature in database
GPG Key ID: 41D6F71EE78E77CD

View File

@ -3,8 +3,8 @@ let instances;
try {
const response = await fetch(new URL("/api/instances", Astro.url));
instances = await response.json();
} catch {
console.error("Couln't fetch instances");
} catch (error) {
console.error("Couln't fetch instances:", error);
instances = [];
}
---