diff --git a/tests/test_components/test_source_frames.py b/tests/test_components/test_source_frames.py index e837fed4bd..f644d07a4b 100644 --- a/tests/test_components/test_source_frames.py +++ b/tests/test_components/test_source_frames.py @@ -68,5 +68,5 @@ def test_source_absorber_frames(): ) ], ) - with pytest.raises(pydantic.ValidationError): - _ = bad_sim._finalized + with pytest.raises(td.exceptions.Tidy3dError): + _ = bad_sim._validate_finalized() diff --git a/tidy3d/components/simulation.py b/tidy3d/components/simulation.py index 3eeace5670..9d933a6c5f 100644 --- a/tidy3d/components/simulation.py +++ b/tidy3d/components/simulation.py @@ -2227,11 +2227,11 @@ def _validate_finalized(self): try: _ = self._finalized - except Exception: - log.error( + except Exception as e: + raise Tidy3dError( "Simulation fails after requested mode source PEC frames are added. " "Please inspect '._finalized'." - ) + ) from e class Simulation(AbstractYeeGridSimulation):