Changeset 62b9793 in sasview for src/sas


Ignore:
Timestamp:
Mar 15, 2017 8:55:43 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:
b9b612a
Parents:
d0764bf
Message:

Direct error message when a data file cannot be loaded by any reader.

File:
1 edited

Legend:

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

    rd0764bf r62b9793  
    7878                    return cansas_loader.read(path) 
    7979                except: 
    80                     cansas_nexus_loader = cansas_reader_HDF5.Reader() 
    81                     return cansas_nexus_loader.read(path) 
     80                    try: 
     81                        cansas_nexus_loader = cansas_reader_HDF5.Reader() 
     82                        return cansas_nexus_loader.read(path) 
     83                    except: 
     84                        msg = "\n\tUnknown data format: %s.\n" % path 
     85                        msg += "\tThe file is not a known format for SasView. " 
     86                        msg += "The most common formats are multi-column " 
     87                        msg += "ASCII, CanSAS XML, andCanSAS NeXuS." 
     88                        raise Exception(msg) 
    8289 
    8390    def find_plugins(self, dir): 
Note: See TracChangeset for help on using the changeset viewer.