Changeset c9dc8c9 in sasview


Ignore:
Timestamp:
May 19, 2016 2:32:20 AM (9 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
0c10782
Parents:
9194009 (diff), faa3ae7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge pull request #8 from SasView?/loader_error_handling

Improve loading error handling

Location:
src/sas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r45d90b9 raf09f48  
    221221                            output.append(return_value) 
    222222                    else: 
    223                         output.append("Invalid XML at: {0}".format(\ 
    224                                                     self.find_invalid_xml())) 
     223                        raise RuntimeError, "Invalid XML at: {0}".format(\ 
     224                                                    self.find_invalid_xml()) 
    225225                except: 
    226226                    # If the file does not match the schema, raise this error 
  • src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py

    rd85c194 rfaa3ae7  
    155155        """ 
    156156        data_error = False 
    157         for error_data in item.errors: 
     157        if hasattr(item, 'errors'): 
     158            for error_data in item.errors: 
     159                data_error = True 
     160                message += "\tError: {0}\n".format(error_data) 
     161        else: 
     162            logging.error("Loader returned an invalid object:\n %s" % str(item)) 
    158163            data_error = True 
    159             message += "\tError: {0}\n".format(error_data) 
     164         
    160165        data = self.parent.create_gui_data(item, p_file) 
    161166        output[data.id] = data 
     
    203208                                                          error_message) 
    204209            except: 
     210                logging.error(sys.exc_value) 
    205211                any_error = True 
    206212            if any_error or error_message != "": 
Note: See TracChangeset for help on using the changeset viewer.