diff --git a/packages/smithy-core/.changes/next-release/smithy-core-enhancement-20251124183509.json b/packages/smithy-core/.changes/next-release/smithy-core-enhancement-20251124183509.json new file mode 100644 index 000000000..56a70a6c1 --- /dev/null +++ b/packages/smithy-core/.changes/next-release/smithy-core-enhancement-20251124183509.json @@ -0,0 +1,4 @@ +{ + "type": "enhancement", + "description": "Improved default error message for instances of ClientTimeoutError." +} \ No newline at end of file diff --git a/packages/smithy-core/src/smithy_core/aio/client.py b/packages/smithy-core/src/smithy_core/aio/client.py index 01f18097b..6060727b4 100644 --- a/packages/smithy-core/src/smithy_core/aio/client.py +++ b/packages/smithy-core/src/smithy_core/aio/client.py @@ -469,9 +469,7 @@ async def _handle_attempt[I: SerializeableShape, O: DeserializeableShape]( ) except Exception as e: if isinstance(e, self.transport.TIMEOUT_EXCEPTIONS): - raise ClientTimeoutError( - message=f"Client timeout occurred: {e}" - ) from e + raise ClientTimeoutError(message="A timeout error occurred.") from e raise _LOGGER.debug("Received response: %s", transport_response) diff --git a/packages/smithy-http/.changes/next-release/smithy-http-enhancement-20251122132342.json b/packages/smithy-http/.changes/next-release/smithy-http-enhancement-20251122132342.json new file mode 100644 index 000000000..d7b9f982e --- /dev/null +++ b/packages/smithy-http/.changes/next-release/smithy-http-enhancement-20251122132342.json @@ -0,0 +1,4 @@ +{ + "type": "enhancement", + "description": "Improved error messaging for CRT-based timeout errors." +} \ No newline at end of file diff --git a/packages/smithy-http/src/smithy_http/aio/crt.py b/packages/smithy-http/src/smithy_http/aio/crt.py index db13162e1..5e5cc861c 100644 --- a/packages/smithy-http/src/smithy_http/aio/crt.py +++ b/packages/smithy-http/src/smithy_http/aio/crt.py @@ -187,7 +187,7 @@ async def send( return await self._await_response(crt_stream) except AwsCrtError as e: if e.name in self._TIMEOUT_ERROR_NAMES: - raise _CRTTimeoutError() from e + raise _CRTTimeoutError(f"CRT {e.name}: {e.message}") from e raise async def _await_response(