From e0ed8150f46e420621667632903f3cf95f5b6a0e Mon Sep 17 00:00:00 2001 From: kareefardi Date: Thu, 26 Oct 2023 15:55:36 +0300 Subject: [PATCH] standardise exception raise by errors found in magic log file --- openlane/steps/magic.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openlane/steps/magic.py b/openlane/steps/magic.py index a7c398cff..382a2c197 100644 --- a/openlane/steps/magic.py +++ b/openlane/steps/magic.py @@ -126,20 +126,20 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: r"Error while reading cell.*", ] + error_found = False for line in open(self.get_log_path(), encoding="utf8"): if "Calma output error" in line: - raise StepError( - f"Magic GDS was written with errors. Check log file of {self.id}" - ) + error_found = True elif "is an abstract view" in line: - raise StepError( - f"Missing GDS view for a macro. Check log file of {self.id}." - ) + error_found = True for pattern in error_patterns: if re.match(pattern, line): - raise StepError( - f"Error encountered during running Magic.\nError: {line}Check the log file of {self.id}." - ) + error_found = True + break + if error_found is True: + raise StepError( + f"Error encountered during running Magic.\nError: {line}Check the log file of {self.id}." + ) return views_updates, metrics_updates