Skip to content

Commit

Permalink
turn exit calls into exceptions (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Dec 5, 2024
2 parents fa457d9 + c2fa20f commit d68a9ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions changes/1545.mosaic_pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Convert calls to ``exit(0)`` within the pipeline into exceptions.
9 changes: 4 additions & 5 deletions romancal/pipeline/mosaic_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ def process(self, input):
# open the input file
file_type = filetype.check(input)
if file_type == "asdf":
log.info("The level three pipeline input needs to be an association")
exit(0)
return
raise TypeError("The level three pipeline input needs to be an association")

if file_type == "asn":
input = ModelLibrary(input, on_disk=self.on_disk)
Expand Down Expand Up @@ -135,8 +133,9 @@ def process(self, input):
self.sourcecatalog.output_file = self.output_file
result_catalog = self.sourcecatalog.run(result)
else:
log.info("resampling a mosaic file is not yet supported")
exit(0)
raise NotImplementedError(
"resampling a mosaic file is not yet supported"
)

else:
self.resample.suffix = "coadd"
Expand Down

0 comments on commit d68a9ca

Please sign in to comment.