Skip to content

Commit 48eae39

Browse files
authored
fix: throw ResourceNotFound when execution doesnt exist in filesystem store (#65)
1 parent 8f3feb5 commit 48eae39

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/aws_durable_execution_sdk_python_testing/stores/filesystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pathlib import Path
99

1010
from aws_durable_execution_sdk_python_testing.exceptions import (
11-
DurableFunctionsLocalRunnerError,
11+
ResourceNotFoundException,
1212
)
1313
from aws_durable_execution_sdk_python_testing.execution import Execution
1414

@@ -74,7 +74,7 @@ def load(self, execution_arn: str) -> Execution:
7474
file_path = self._get_file_path(execution_arn)
7575
if not file_path.exists():
7676
msg = f"Execution {execution_arn} not found"
77-
raise DurableFunctionsLocalRunnerError(msg)
77+
raise ResourceNotFoundException(msg)
7878

7979
with open(file_path, encoding="utf-8") as f:
8080
data = json.load(f, object_hook=datetime_object_hook)

tests/stores/filesystem_store_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77

88
from aws_durable_execution_sdk_python_testing.exceptions import (
9-
DurableFunctionsLocalRunnerError,
9+
ResourceNotFoundException,
1010
)
1111
from aws_durable_execution_sdk_python_testing.execution import Execution
1212
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):
6464

6565

6666
def test_filesystem_execution_store_load_nonexistent(store):
67-
"""Test loading a nonexistent execution raises DurableFunctionsLocalRunnerError."""
67+
"""Test loading a nonexistent execution raises ResourceNotFoundException."""
6868
with pytest.raises(
69-
DurableFunctionsLocalRunnerError, match="Execution nonexistent-arn not found"
69+
ResourceNotFoundException, match="Execution nonexistent-arn not found"
7070
):
7171
store.load("nonexistent-arn")
7272

0 commit comments

Comments
 (0)