Skip to content

Commit

Permalink
Added exception debug statements for more binary debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Blumberg committed Sep 21, 2019
1 parent 5d1f04b commit 5a66959
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions runsharp/full_gui.py
Expand Up @@ -125,6 +125,7 @@ def doCrasher(*args, **kwargs):
data = "SHARPpy v%s %s\n" % (__version__, __version_name__) + \
"Crash time: %s\n" % str(date.datetime.now()) + \
traceback.format_exc()
logging.exception(e)
print("Exception:", e)
# HERE IS WHERE YOU CAN CATCH A DATAQUALITYEXCEPTION
if frozenutils.isFrozen():
Expand Down Expand Up @@ -294,9 +295,9 @@ def __initUI(self):
[t.strftime(Picker.run_format) for t in filt_times])
try:
self.run_dropdown.setCurrentIndex(filt_times.index(self.run))
except ValueError:
except ValueError as e:
logging.error("Run dropdown is missing its times ... ?")

logging.exception(e)
# connect the click actions to functions that do stuff
self.model_dropdown.activated.connect(self.get_model)
self.map_dropdown.activated.connect(self.get_map)
Expand Down Expand Up @@ -508,6 +509,7 @@ def update(times):
self.run = [t for t in times if t.hour in synoptic_times and t.day == self.cal_date.day(
) and t.month == self.cal_date.month() and t.year == self.cal_date.year()][-1]
except Exception as e:
logging.exception(e)
self.run = times[-1]
else:
self.run = times[-1]
Expand Down Expand Up @@ -589,8 +591,9 @@ def complete_name(self):
while True:
try:
self.skewApp(ntry=n_tries)
except data_source.DataSourceError:
except data_source.DataSourceError as e1:
# We've run out of data sources. Uh-oh.
logging.exception(e1)
if self.skew is not None:
self.skew.closeIfEmpty()
raise IOError(
Expand All @@ -599,6 +602,7 @@ def complete_name(self):
if debug:
print(traceback.format_exc())
n_tries += 1
logging.exception(e)
else:
break

Expand Down Expand Up @@ -779,7 +783,8 @@ def loadArchive(self, filename):
try:
dec = deccls(filename)
break
except:
except Exception as e:
logging.exception(e)
dec = None
continue

Expand Down Expand Up @@ -1094,7 +1099,8 @@ def search_and_plotDB(model, station, datetime, close=True, output='./'):
main_win.picker.disp_name = main_win.picker.loc['icao']
try:
main_win.picker.skewApp()
except data_source.DataSourceError:
except data_source.DataSourceError as e:
logging.exception(e)
print(FAIL + "Couldn't find data for the requested time and location." + ENDC)
return main_win

Expand Down

0 comments on commit 5a66959

Please sign in to comment.