From f3e25f8340fc8813f622cc1d6c0ba734019c4c8a Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 26 Nov 2024 13:09:47 -0500 Subject: [PATCH] turn exit calls into exceptions --- romancal/pipeline/mosaic_pipeline.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index 0276225fe..ee0dc451b 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -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) @@ -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 = "i2d"