Show error messages for invalid file load attempts
Closed this issue · 2 comments
Thanks for making such a kickass tool 🌮 🌮 As I said on DW I'd be happy to help in any way I can.
Quick thing for now though is that it would be nice if the UI told you when you try to upload an invalid file type, or when loading from URL fails for any reason (CORS issue, not a valid file type, or field left empty). It looks like in such cases errors are getting spit out in the console, but the UI still displays a loading thing indefinitely.
I think I haven't added any error checking in the wad.js library yet. I guess a quick fix is to just add a try/catch thing to the frontend but it will definitely need library support too, for nicer errors.
Simplest check to do is to see if the first four bytes compare to the ASCII string "IWAD" or "PWAD". Some other trivial checks:
- See if the amount of memory required for the number of lumps would exceed the wad size (broken wad)
- Compare the hash against official DOOM wads. If they match, then no other checking needs to be done because you already know the integrity is valid. Also useful for checking integrity of downloads when loading from another URL