Fix logic in PDF generation failure error