antag99 / TExtract

An extractor for Terraria's content files
MIT License
33 stars 6 forks source link

Uncaught exceptions freeze program #3

Open Zoybean opened 7 years ago

Zoybean commented 7 years ago

If an incompatible file is encountered, rather than giving a warning and skipping the file, the program freezes, with an exception logged in the terminal. I encountered the following two:

Exception in thread "main" ai: unsupported asset type: xTile.Pipeline.TideReader at aj.a(Unknown Source) at L.a(Unknown Source) at L.a(Unknown Source) at L.a(Unknown Source) at com.github.antag99.textract.TExtract.main(Unknown Source)

Exception in thread "Thread-1" ai: unsupported asset type: Microsoft.Xna.Framework.Content.DictionaryReader`2[[System.String at aj.a(Unknown Source) at L.a(Unknown Source) at L.a(Unknown Source) at L.a(Unknown Source) at L.a(Unknown Source) at Q.run(Unknown Source)

This was encountered when attempting to extract .xnb image files from Stardew Valley, but every non-image file encountered would crash the progam.

antag99 commented 7 years ago

Sounds impractical; indeed it would be much better if the program just emitted a warning for incompatible files. In order to save time, I only implemented the asset types that were necessary to extract Terraria's files back when I wrote the code. It seems like xTile.Pipeline.TideReader is something implemented in Stardew Valley, rather than the XNA framework, so TExtract will never support that (unless an extension mechanism is implemented). I can't fix the crashing problem right now, but may do so in the coming weeks.

nicolascrafter commented 6 years ago

Using this command on the cmd:

C:\Users\usuario\Downloads\terraria\herramientas\textract>java -jar "TExtract 1.7.0.jar" --logFile

Gives me that exception:

00:07  INFO: Extracting files from Fonts/
00:07 TRACE: Combat_Crit.xnb
Exception in thread "Thread-3" ai: unsupported asset type: ReLogic.Graphics.DynamicSpriteFontReader
        at aj.a(Unknown Source)
        at L.a(Unknown Source)
        at L.a(Unknown Source)
        at L.a(Unknown Source)
        at Q.run(Unknown Source)

This exception only appears in the cmd window.