aVadim483 / fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP
MIT License
177 stars 31 forks source link

Show correct error when unable to create a zip #83

Closed claspina closed 2 months ago

claspina commented 2 months ago

When saveToFile method is called with an invalid name or insufficient permissions

Current exception is:

Could not write entry "[Content_Types].xml" to zip

This error occurs because when trying to execute writeEntryToZip the zip wasn't created properly

The correct exception has to be

Unable to create zip "pathname_with_incorrect_name_or_permission.xlsx". Error code "XX"

Where XX corresponds to the return values section of ZipArchive according to the official docs