Skip to content

Commit 7f467ed

Browse files
committed
feat: error handling
1 parent f5dd687 commit 7f467ed

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

apps/website/src/util/fetchNode.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ export async function fetchNode({
2525
);
2626

2727
return JSON.parse(fileContent);
28-
} catch {
28+
} catch (error_) {
29+
console.error(error_);
2930
notFound();
3031
}
3132
}
@@ -38,7 +39,8 @@ export async function fetchNode({
3839
);
3940

4041
return await fileContent.json();
41-
} catch {
42+
} catch (error_) {
43+
console.error(error_);
4244
notFound();
4345
}
4446
}

apps/website/src/util/fetchSitemap.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export async function fetchSitemap({
1818
);
1919

2020
return JSON.parse(fileContent);
21-
} catch {
21+
} catch (error_) {
22+
console.error(error_);
2223
notFound();
2324
}
2425
}
@@ -31,7 +32,8 @@ export async function fetchSitemap({
3132
);
3233

3334
return await fileContent.json();
34-
} catch {
35+
} catch (error_) {
36+
console.error(error_);
3537
notFound();
3638
}
3739
}

0 commit comments

Comments
 (0)