Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/AddMultEditor.py

    raed0532 r287d356  
    1515import re 
    1616import logging 
     17import traceback 
     18 
    1719import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    1820from sasmodels.sasview_model import load_standard_models 
     
    202204                                     self.cbOperator.currentText()) 
    203205 
    204         success = GuiUtils.checkModel(self.plugin_filename) 
     206        try: 
     207            success = GuiUtils.checkModel(self.plugin_filename) 
     208        except Exception as ex: 
     209            # broad exception from sasmodels 
     210            msg = "Error building model: "+ str(ex) 
     211            logging.error(msg) 
     212            #print three last lines of the stack trace 
     213            # this will point out the exact line failing 
     214            last_lines = traceback.format_exc().split('\n')[-4:] 
     215            traceback_to_show = '\n'.join(last_lines) 
     216            logging.error(traceback_to_show) 
     217 
     218            # Set the status bar message 
     219            self.parent.communicate.statusBarUpdateSignal.emit("Model check failed") 
     220            return 
    205221 
    206222        if not success: 
Note: See TracChangeset for help on using the changeset viewer.