feat: error handling

This commit is contained in:
iCrawl 2024-05-24 01:57:50 +02:00
parent f5dd6879a2
commit 7f467ed2d1
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View file

@ -25,7 +25,8 @@ export async function fetchNode({
); );
return JSON.parse(fileContent); return JSON.parse(fileContent);
} catch { } catch (error_) {
console.error(error_);
notFound(); notFound();
} }
} }
@ -38,7 +39,8 @@ export async function fetchNode({
); );
return await fileContent.json(); return await fileContent.json();
} catch { } catch (error_) {
console.error(error_);
notFound(); notFound();
} }
} }

View file

@ -18,7 +18,8 @@ export async function fetchSitemap({
); );
return JSON.parse(fileContent); return JSON.parse(fileContent);
} catch { } catch (error_) {
console.error(error_);
notFound(); notFound();
} }
} }
@ -31,7 +32,8 @@ export async function fetchSitemap({
); );
return await fileContent.json(); return await fileContent.json();
} catch { } catch (error_) {
console.error(error_);
notFound(); notFound();
} }
} }