a tool for shared writing and social publishing

add some logging sequential image upload

+10 -4
+10 -4
actions/publishToPublication.ts
··· 89 89 let data = await fetch(b.data.src); 90 90 if (data.status !== 200) continue; 91 91 let binary = await data.blob(); 92 - let blob = await agent.com.atproto.repo.uploadBlob(binary, { 93 - headers: { "Content-Type": binary.type }, 94 - }); 95 - imageMap.set(b.data.src, blob.data.blob); 92 + try { 93 + let blob = await agent.com.atproto.repo.uploadBlob(binary, { 94 + headers: { "Content-Type": binary.type }, 95 + }); 96 + imageMap.set(b.data.src, blob.data.blob); 97 + } catch (e) { 98 + console.error(e); 99 + console.log("Error uploading image: " + b.data.src); 100 + throw new Error("Failed to upload image"); 101 + } 96 102 } 97 103 98 104 let b: PubLeafletPagesLinearDocument.Block[] = blocksToRecord(