mirror of
				https://github.com/Eledio/superfaktura-client.git
				synced 2025-10-31 16:11:20 +01:00 
			
		
		
		
	add_invoice: add try-except clause
This commit is contained in:
		| @@ -75,8 +75,12 @@ def main(): | ||||
|         invoice_settings=InvoiceSettings(language=Language.English), | ||||
|     ) | ||||
|  | ||||
|     with open("invoice.pdf", "wb") as f: | ||||
|         invoice.get_pdf(invoice=resp, descriptor=f, language=Language.English) | ||||
|     try: | ||||
|         with open("invoice.pdf", "wb") as f: | ||||
|             invoice.get_pdf(invoice=resp, descriptor=f, language=Language.English) | ||||
|         print("Invoice saved to 'invoice.pdf'") | ||||
|     except Exception as e: | ||||
|         print(f"Error generating or saving invoice as PDF: {e}") | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|   | ||||
		Reference in New Issue
	
	Block a user