Skip to content

Commit

Permalink
feat: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed May 23, 2024
1 parent f5dd687 commit 7f467ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/website/src/util/fetchNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export async function fetchNode({
);

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

return await fileContent.json();
} catch {
} catch (error_) {
console.error(error_);
notFound();
}
}
6 changes: 4 additions & 2 deletions apps/website/src/util/fetchSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export async function fetchSitemap({
);

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

return await fileContent.json();
} catch {
} catch (error_) {
console.error(error_);
notFound();
}
}

0 comments on commit 7f467ed

Please sign in to comment.