Raytwo / Cobalt

Modding dependency for Fire Emblem Engage
40 stars 3 forks source link

[Panic] Fails to gracefully handle unreadable zip files #50

Closed sophxm closed 2 weeks ago

sophxm commented 3 weeks ago

System Firmware Version

18.1.0

Atmosphere Version

N/A

Cobalt Version

1.14.0

Steps to reproduce

On any platform: 1) Add a corrupted or invalid zip file (e.g. an empty file named test.zip) to engage/mods/ 2) Boot the game

Can also occur if the file is unreadable for other reasons (panics on yuzu if the file is locked, for example, although I know it's unsupported).

Details

KernelSvc OutputDebugString: Location: crates\mods\src\vfs.rs:72:68
KernelSvc OutputDebugString: called `Result::unwrap()` on an `Err` value: InvalidArchive("Invalid zip header")

Minimal modpack to reproduce the panic

No response

Raytwo commented 2 weeks ago

Sure, something can be done about this, thanks for reporting.

Raytwo commented 2 weeks ago

Perfect solution would've been to ignore the mod and proceed but the code for managing mod is currently too bad to do so. I implemented more descriptive error messages instead in an effort to help figure out the issue for users.

A better implementation will be made alongside the filesystem rework that's in discussion. Thanks for the report!