diff --git a/packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/exceptions.py b/packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/exceptions.py index d51ab961..ea3f163f 100644 --- a/packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/exceptions.py +++ b/packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python/exceptions.py @@ -13,7 +13,7 @@ TOO_MANY_REQUESTS_ERROR: int = 429 SERVICE_ERROR: int = 500 INVALID_PARAMETER_VALUE_EXCEPTION: str = "InvalidParameterValueException" -INVALID_CHECKPOINT_TOKEN_PREFIX: str = "Invalid Checkpoint Token" +INVALID_CHECKPOINT_TOKEN_PREFIX: str = "Invalid checkpoint token" # Non-retryable customer error codes that arrive as non-4xx (e.g. HTTP 502) from Lambda. # Unlike typical 5xx errors, these require customer intervention (e.g., fixing @@ -162,7 +162,7 @@ def _classify_error_category( These arrive as HTTP 502 but require customer intervention to fix. - 4xx errors → EXECUTION, except: - 429 (TooManyRequests) → INVOCATION (throttling is transient) - - InvalidParameterValueException with "Invalid Checkpoint Token" → INVOCATION + - InvalidParameterValueException with "Invalid checkpoint token" (exact match) → INVOCATION (stale token from a concurrent checkpoint; next invocation gets a fresh token) - 5xx, network errors → INVOCATION """ diff --git a/packages/aws-durable-execution-sdk-python/tests/exceptions_test.py b/packages/aws-durable-execution-sdk-python/tests/exceptions_test.py index 3ae6b1fb..540f09fa 100644 --- a/packages/aws-durable-execution-sdk-python/tests/exceptions_test.py +++ b/packages/aws-durable-execution-sdk-python/tests/exceptions_test.py @@ -66,11 +66,11 @@ def test_checkpoint_error(): def test_checkpoint_error_classification_invalid_token_invocation(): - """Test 4xx InvalidParameterValueException with Invalid Checkpoint Token is invocation error.""" + """Test 4xx InvalidParameterValueException with "Invalid checkpoint token" error message is an invocation error.""" error_response = { "Error": { "Code": "InvalidParameterValueException", - "Message": "Invalid Checkpoint Token: token expired", + "Message": "Invalid checkpoint token: token expired", }, "ResponseMetadata": {"HTTPStatusCode": 400}, }