Ignore:
Timestamp:
Apr 5, 2017 11:08:59 AM (8 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
278ddee
Parents:
69400ec
git-author:
Jeff Krzywon <krzywon@…> (04/05/17 11:08:59)
git-committer:
krzywon <krzywon@…> (04/05/17 11:08:59)
Message:

More explicit error messages when file loading fails. see #889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/loader.py

    r270c882b r7f75a3f  
    7070        except NoKnownLoaderException as e: 
    7171            pass  # try the ASCII reader 
    72         except FileContentsException as e: 
    73             pass 
    7472        try: 
    7573            ascii_loader = ascii_reader.Reader() 
     
    8684            return cansas_nexus_loader.read(path) 
    8785        except FileContentsException: 
     86            logging.errors("No default loader can load the data") 
    8887            # No known reader available. Give up and throw an error 
    8988            msg = "\n\tUnknown data format: %s.\n\tThe file is not a " % path 
    90             msg += "known format that can be loaded by SasView." 
    91             raise NoKnownLoaderException(msg) 
     89            msg += "known format that can be loaded by SasView.\n" 
     90            msg += "Traceback:\n%s" % e.message 
     91            raise NoKnownLoaderException, msg 
    9292 
    9393    def find_plugins(self, dir): 
Note: See TracChangeset for help on using the changeset viewer.