File tree Expand file tree Collapse file tree
examples/vue-tailwind/src/components
packages/engines/src/lib/orchestrator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,9 @@ const handleSubmit = async () => {
9696 errorMessage .value = ' ' ;
9797
9898 try {
99- await documentManager .retryLoadDocumentWithPassword (props .documentState .id , password .value );
99+ await documentManager .value ?.retryDocument (props .documentState .id , {
100+ password: password .value ,
101+ });
100102 } catch (error ) {
101103 errorMessage .value = ' Incorrect password. Please try again.' ;
102104 password .value = ' ' ;
@@ -108,6 +110,6 @@ const handleSubmit = async () => {
108110
109111const handleCancel = () => {
110112 if (! documentManager ) return ;
111- documentManager .closeDocument (props .documentState .id );
113+ documentManager .value ?. closeDocument (props .documentState .id );
112114};
113115 </script >
Original file line number Diff line number Diff line change @@ -165,13 +165,15 @@ export class PdfEngine<T = Blob> implements IPdfEngine<T> {
165165 content : arrayBuf ,
166166 } ;
167167
168- // Then open in worker
169- const doc = await this . openDocumentBuffer ( pdfFile , {
168+ // Then open in worker - use wait() to properly propagate task errors
169+ this . openDocumentBuffer ( pdfFile , {
170170 password : options ?. password ,
171- } ) . toPromise ( ) ;
172-
173- task . resolve ( doc ) ;
171+ } ) . wait (
172+ ( doc ) => task . resolve ( doc ) ,
173+ ( error ) => task . fail ( error ) ,
174+ ) ;
174175 } catch ( error ) {
176+ // This only catches fetch errors (network issues, etc.)
175177 task . reject ( { code : PdfErrorCode . Unknown , message : String ( error ) } ) ;
176178 }
177179 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments