Skip to content

Commit

Permalink
Improved some error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertLuptonTheGood committed Jul 6, 2017
1 parent 7fa1301 commit 4881af2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/lsst/pipe/tasks/ingestCalibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def getCalibType(self, filename):
"""
md = afwImage.readMetadata(filename, self.config.hdu)
if not md.exists("OBSTYPE"):
raise RuntimeError("Unable to find the required header keyword OBSTYPE")
raise RuntimeError("Unable to find the required header keyword OBSTYPE in %s, hdu %d" %
(filename, self.config.hdu))
obstype = md.get("OBSTYPE").strip().lower()
if "flat" in obstype:
obstype = "flat"
Expand Down Expand Up @@ -220,8 +221,9 @@ def run(self, args):
else:
calibType = args.calibType
if calibType not in self.register.config.tables:
self.log.warn(str("Skipped adding %s of observation type '%s' to registry" %
(infile, calibType)))
self.log.warn(str("Skipped adding %s of observation type '%s' to registry "
"(must be one of %s)" %
(infile, calibType, ", ".join(self.register.config.tables))))
continue
if args.mode != 'skip':
outfile = self.parse.getDestination(args.butler, fileInfo, infile)
Expand Down

0 comments on commit 4881af2

Please sign in to comment.