Changeset b65ae90 in sasview for src/sans/dataloader


Ignore:
Timestamp:
Apr 1, 2014 4:22:22 AM (11 years ago)
Author:
Jeff Krzywon <jeffery.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.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:
b099388
Parents:
d0ac63f
Message:

Fixed the issue with error handling in the cansas reader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sans/dataloader/readers/cansas_reader.py

    r92c8fec rb65ae90  
    305305                            return 
    306306                        except: 
    307                             err_msg = "error occured" 
     307                            err_msg = "CanSAS reader: could not convert the units" 
     308                            self.errors.append(err_msg) 
    308309                            return 
    309310                    else: 
     
    414415                                            or node_value.lower() == "nan": 
    415416                        node_value = "0.0" 
    416                     try: 
    417                         node_value, unit = self._unit_conversion(\ 
     417                    node_value, unit = self._unit_conversion(\ 
    418418                                cs_values.current_level, attr, data1d, \ 
    419419                                tagname, node_value, cs_values.ns_optional) 
    420                     except TypeError: 
    421                         print "TypeError with units of {0} and node of {1}".format(attr['unit'], tagname) 
    422420                     
    423421                # If appending to a dictionary (meta_data | run_name) 
     
    463461                        except AttributeError as e: 
    464462                            pass 
    465                              
    466                       
     463             
     464            except TypeError: 
     465                pass 
    467466            except Exception as e: 
    468467                exc_type, exc_obj, exc_tb = sys.exc_info() 
Note: See TracChangeset for help on using the changeset viewer.