feat: wrap article and user service functions with TypedResult for improved error handling

This commit is contained in:
2026-04-11 01:48:09 -03:00
parent 94e8058880
commit af17b6dc5a
10 changed files with 363 additions and 240 deletions

View File

@@ -70,7 +70,9 @@ const ArticleContentSkeleton = () => (
const ArticleContent = async ({ params }: ArticleContentProps) => {
const { slug } = await params;
const article = await getArticleBySlug(slug);
const articleResult = await getArticleBySlug(slug);
if (!articleResult.ok) throw articleResult.error;
const article = articleResult.value;
if (!article) notFound();