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 = [];
}
---