Coverage for async_durable_execution/_runner/exceptions.py: 100%
20 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-08-30 23:43 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-08-30 23:43 +0000
1"""Exceptions raised by the Durable Executions Testing Library."""
3from __future__ import annotations
6class DurableFunctionsLocalRunnerError(Exception):
7 """Base class for Durable Executions exceptions"""
10class DurableFunctionsTestError(Exception):
11 """Base class for testing errors."""
14class AwsApiException(DurableFunctionsLocalRunnerError): # noqa: N818
15 """Base class for local errors corresponding to AWS API failures."""
17 http_status_code: int = 500 # Default to server error
20# Smithy-Mapped Exceptions (defined in Smithy models)
21class InvalidParameterValueException(AwsApiException):
22 """Exception for invalid parameter values."""
24 http_status_code = 400
26 def __init__(self, message: str | None) -> None:
27 """Initialize with message field (lowercase per Smithy definition)."""
28 self.message = message
29 super().__init__(message)
32class ResourceNotFoundException(AwsApiException):
33 """Exception for resource not found errors."""
35 http_status_code = 404
37 def __init__(
38 self,
39 Message: str, # noqa: N803
40 ) -> None: # Capital M per Smithy definition
41 """Initialize with Message field (capital M per Smithy definition)."""
42 self.Message = Message
43 super().__init__(Message)
46# Unmapped Exceptions (thrown by services but not in Smithy)
47class IllegalStateException(AwsApiException):
48 """IllegalStateException."""
50 http_status_code = 500
52 def __init__(self, message: str) -> None:
53 """Initialize with message field."""
54 self.message = message
55 super().__init__(message)