From 2c2865cfc34e5e8133393c2217f46fc8acf1ae71 Mon Sep 17 00:00:00 2001 From: Brent Champion Date: Fri, 17 Oct 2025 17:45:27 -0400 Subject: [PATCH] fix: throw ResourceNotFound when execution doesnt exist in filesystem store --- .../stores/filesystem.py | 4 ++-- tests/stores/filesystem_store_test.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aws_durable_execution_sdk_python_testing/stores/filesystem.py b/src/aws_durable_execution_sdk_python_testing/stores/filesystem.py index 3b5e0c9..3da15a4 100644 --- a/src/aws_durable_execution_sdk_python_testing/stores/filesystem.py +++ b/src/aws_durable_execution_sdk_python_testing/stores/filesystem.py @@ -8,7 +8,7 @@ from pathlib import Path from aws_durable_execution_sdk_python_testing.exceptions import ( - DurableFunctionsLocalRunnerError, + ResourceNotFoundException, ) from aws_durable_execution_sdk_python_testing.execution import Execution @@ -74,7 +74,7 @@ def load(self, execution_arn: str) -> Execution: file_path = self._get_file_path(execution_arn) if not file_path.exists(): msg = f"Execution {execution_arn} not found" - raise DurableFunctionsLocalRunnerError(msg) + raise ResourceNotFoundException(msg) with open(file_path, encoding="utf-8") as f: data = json.load(f, object_hook=datetime_object_hook) diff --git a/tests/stores/filesystem_store_test.py b/tests/stores/filesystem_store_test.py index b80c86f..0467959 100644 --- a/tests/stores/filesystem_store_test.py +++ b/tests/stores/filesystem_store_test.py @@ -6,7 +6,7 @@ import pytest from aws_durable_execution_sdk_python_testing.exceptions import ( - DurableFunctionsLocalRunnerError, + ResourceNotFoundException, ) from aws_durable_execution_sdk_python_testing.execution import Execution from aws_durable_execution_sdk_python_testing.model import StartDurableExecutionInput @@ -64,9 +64,9 @@ def test_filesystem_execution_store_save_and_load(store, sample_execution): def test_filesystem_execution_store_load_nonexistent(store): - """Test loading a nonexistent execution raises DurableFunctionsLocalRunnerError.""" + """Test loading a nonexistent execution raises ResourceNotFoundException.""" with pytest.raises( - DurableFunctionsLocalRunnerError, match="Execution nonexistent-arn not found" + ResourceNotFoundException, match="Execution nonexistent-arn not found" ): store.load("nonexistent-arn")