Skip to content

Commit

Permalink
add debug logging to all catch-all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hamogu committed Feb 1, 2019
1 parent aef9a82 commit b3bf16e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
5 changes: 3 additions & 2 deletions specutils/io/default_loaders/hst_cos.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def cos_identify(origin, *args, **kwargs):
return True
else:
return False
except:
logging.exception("Tried to read this as HST/COS file, but could not.")
except Exception as e:
logging.debug("Tried to read this as HST/COS file, but could not.")
logging.debug(e, exc_info=True)
return False

@data_loader(label="HST/COS", identifier=cos_identify, extensions=['FITS', 'FIT', 'fits', 'fit'])
Expand Down
5 changes: 3 additions & 2 deletions specutils/io/default_loaders/hst_stis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def stis_identify(origin, *args, **kwargs):
return True
else:
return False
except:
logging.exception("Tried to read this as HST/COS file, but could not.")
except Exception as e:
logging.debug("Tried to read this as HST/COS file, but could not.")
logging.debug(e, exc_info=True)
return False


Expand Down
4 changes: 3 additions & 1 deletion specutils/io/default_loaders/muscles_sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def identify_muscles_sed(origin, *args, **kwargs):
fits.open(args[0])[0].header['PROPOSID'] == 13650
)
return ismuscles
except:
except Exception as e:
logging.debug("Tried to read as MUSCLES SED file, but could not.")
logging.debug(e, exc_info=True)
return False

@data_loader("muscles-sed", identifier=identify_muscles_sed,
Expand Down
4 changes: 3 additions & 1 deletion specutils/io/default_loaders/tabular_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def identify_tabular_fits(origin, *args, **kwargs):
isinstance(fits.open(args[0])[1], fits.BinTableHDU)
)
return istabfits
except:
except Exception as e:
logging.debug("Tried to read as tabular fits file, but could not.")
logging.debug(e, exc_info=True)
return False


Expand Down
4 changes: 3 additions & 1 deletion specutils/io/default_loaders/wcs_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def identify_wcs1d_fits(origin, *args, **kwargs):
'CTYPE1' in fits.getheader(args[0])
)
return iswcsfits
except:
except Exception as e:
logging.debug("Tried to read as fits WCS file, but could not.")
logging.debug(e, exc_info=True)
return False


Expand Down

0 comments on commit b3bf16e

Please sign in to comment.