blish-hud / Pathing

[Module] The official pathing module which adds marker and trail support to Blish HUD.
https://blishhud.com/docs/markers/
MIT License
12 stars 10 forks source link

Corrupt or otherwise invalid packs throw uncaught exceptions #52

Closed dlamkins closed 2 years ago

dlamkins commented 2 years ago
20:53:52.8276 | ERROR | Blish_HUD.Modules.Module | Module "Pathing (bh.community.pathing) v0.13.6" had an unhandled exception while loading.
System.IO.InvalidDataException: End of Central Directory record could not be found.
   at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
   at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
   at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)
   at TmfLib.Content.AsyncSafeZipArchive.GetArchive() in C:\Users\dade\source\repos\TmfLib\Content\AsyncSafeZipArchive.cs:line 51
   at TmfLib.Content.AsyncSafeZipArchive.InitMetadata() in C:\Users\dade\source\repos\TmfLib\Content\AsyncSafeZipArchive.cs:line 27
   at TmfLib.Content.ZipArchiveReader..ctor(String archivePath, String subPath) in C:\Users\dade\source\repos\TmfLib\Content\ZipArchiveReader.cs:line 21
   at TmfLib.Pack.FromArchivedMarkerPack(String archivePath) in C:\Users\dade\source\repos\TmfLib\Pack.cs:line 31
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at BhModule.Community.Pathing.PackInitiator.<LoadPackedPackFiles>d__14.MoveNext() in C:\Users\dade\source\repos\Pathing\PackInitiator.cs:line 111
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at BhModule.Community.Pathing.PackInitiator.<LoadAllPacks>d__17.MoveNext() in C:\Users\dade\source\repos\Pathing\PackInitiator.cs:line 130
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at BhModule.Community.Pathing.PackInitiator.<Init>d__12.MoveNext() in C:\Users\dade\source\repos\Pathing\PackInitiator.cs:line 101
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at BhModule.Community.Pathing.PathingModule.<LoadAsync>d__24.MoveNext() in C:\Users\dade\source\repos\Pathing\PathingModule.cs:line 124

Notably when somebody uses a zip that is partially downloaded.

REF: https://discord.com/channels/531175899588984842/534492012263636992/895503929721376769

dlamkins commented 2 years ago

https://pastebin.com/vGV8bYbp

dlamkins commented 2 years ago

Resolved in the latest commits. Will be included in v0.18.3.