refacto : error detection in home and fallback in books/id
This commit is contained in:
@@ -5,6 +5,7 @@ import { BookService } from "@/lib/services/book.service";
|
||||
import { notFound } from "next/navigation";
|
||||
import { withPageTiming } from "@/lib/hoc/withPageTiming";
|
||||
import { KomgaBookWithPages } from "@/types/komga";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
|
||||
async function BookPage({ params }: { params: { bookId: string } }) {
|
||||
try {
|
||||
@@ -17,7 +18,11 @@ async function BookPage({ params }: { params: { bookId: string } }) {
|
||||
);
|
||||
} catch (error) {
|
||||
console.error("Erreur:", error);
|
||||
notFound();
|
||||
return (
|
||||
<div className="container py-8 space-y-8">
|
||||
<ErrorMessage error={error as Error} errorCode="BOOK_FETCH_ERROR" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user