SasView / sasdata

Package for loading and handling SAS data
BSD 3-Clause "New" or "Revised" License
1 stars 2 forks source link

Loading incompatible data file throws too much junk info #10

Open rozyczko opened 2 years ago

rozyczko commented 2 years ago

When attempting to load a datafile which is not in a known format (e.g. trying to load a .gif file) the error message is correct

sas.sascalc.dataloader.loader_exceptions.NoKnownLoaderException: Generic readers failed to load D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif
13:53:04 - ERROR: Generic readers failed to load D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif
Unknown data format: D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif.
The file is not a known format that can be loaded by SasView.

BUT there is also an unnecessary file printout, causing tons of hex junk (the whole content of the gif) being displayed in the terminal

sas.sascalc.dataloader.loader_exceptions.NoKnownLoaderException: No loaders match extension in 'D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif'
13:53:04 - INFO: Start tag expected, '<' not found, line 1, column 1 (D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif, line 1)
13:53:04 - WARNING: CanSAS Reader could not load D:/projects/sasview/src/sas/sasview/test/image_data/ISIS_98940_greyscale_gif.gif
13:53:04 - WARNING: NXcanSAS Reader could not load file ISIS_98940_greyscale_gif.gif.gif
13:53:04 - WARNING: Unable to decode b'GIF89aS\x01U\x01\xf7\x00\x00\x01\x01\x01sss\xa9\xa9\xa9EEE\x91\x91 ......

This is only affecting local (developer) builds - the GUI only shows the actual error/comment in the Log Explorer.

krzywon commented 2 years ago

This seems similar to SasView/sasdata#4. I haven't had a chance to work on that one yet, but I'm hoping for 5.0.6/5.1.