Changeset e258c53 in sasview for src/sas


Ignore:
Timestamp:
Oct 3, 2018 9:39:22 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
a486918
Parents:
3b95b3b
Message:

+1 to user experience. Exceptions don't crash SV - the just show in the
log explorer (and console, if any).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/GuiManager.py

    r4cbd87f re258c53  
    55import json 
    66import webbrowser 
     7import traceback 
    78 
    89from PyQt5.QtWidgets import * 
     
    6869        QLocale.setDefault(QLocale('en_US')) 
    6970 
     71        # Redefine exception hook to not explicitly crash the app. 
     72        sys.excepthook = self.info 
     73 
    7074        # Add signal callbacks 
    7175        self.addCallbacks() 
     
    103107                                              "_downloads", 
    104108                                              "Tutorial.pdf")) 
     109 
     110    def info(self, type, value, tb): 
     111        logger.error("SasView threw exception: " + str(value)) 
     112        traceback.print_exception(type, value, tb) 
    105113 
    106114    def addWidgets(self): 
Note: See TracChangeset for help on using the changeset viewer.