magnars / optimus

A Ring middleware for frontend performance optimization.
364 stars 23 forks source link

Recover from bad zip files on class-path #67

Open tslocke opened 4 years ago

tslocke commented 4 years ago

Running optimus inside Datomic Ions, I was getting an exception "zip file is empty". With this patch, get-jar-paths returns [] if there is any problem opening the zip file.

If a more focussed catch is preferable, the exception I'm getting is:

#error {:cause "zip file is empty"
        :via [{:type java.util.zip.ZipException, :message "zip file is empty"}]}
magnars commented 4 years ago

Thanks! What a weird issue. I think we should be more focused in catching this, or it might hide real problems.