Added error handling with pdf

pull/41/head
s8613 2025-05-29 09:30:01 +02:00
parent f99700c696
commit efcf4fb831
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ export default function PDFViewer() {
alignItems: 'center',
}}
>
<Document file={testPDF} onLoadSuccess={onDocumentLoadSuccess}>
<Document file={testPDF}
onLoadSuccess={onDocumentLoadSuccess}
onLoadError={(error) => console.error('Es gab ein Fehler beim Laden des PDFs:', error)}
onSourceError={(error) => console.error('Ungültige PDF:', error)}>
{containerWidth && (
<Page
pageNumber={pageNumber}