diff --git a/src/xml.tsx b/src/xml.tsx index 828f104e..879e35de 100644 --- a/src/xml.tsx +++ b/src/xml.tsx @@ -124,7 +124,10 @@ export function SvgXml(props: XmlProps) { export async function fetchText(uri: string) { const response = await fetch(uri); - return await response.text(); + if (response.ok) { + return await response.text(); + } + throw new Error(`Fetching ${uri} failed with status ${response.status}`); } export function SvgUri(props: UriProps) {