feat: error handling

This commit is contained in:
iCrawl
2024-05-24 01:57:50 +02:00
parent f5dd6879a2
commit 7f467ed2d1
2 changed files with 8 additions and 4 deletions

View File

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

View File

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