diff --git a/src/pages/country/[code].astro b/src/pages/country/[code].astro index c2cbeb6..aa0f5a5 100644 --- a/src/pages/country/[code].astro +++ b/src/pages/country/[code].astro @@ -6,7 +6,12 @@ import type { Country } from '../../types/country'; const country: Country = Astro.props; export const getStaticPaths = async () => { - const countryData = await fetchCountryData(); + let countryData: Country[] = []; + try { + countryData = await fetchCountryData(); + } catch (error) { + console.log(error); + } async function fetchCountryData() { const url = new URL(`${import.meta.env.API_BASE_URL}/country.json`);