Skip to content

Commit 12c3e0a

Browse files
authored
Update error messages for timeout errors (#607)
1 parent 685f749 commit 12c3e0a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "enhancement",
3+
"description": "Improved default error message for instances of ClientTimeoutError."
4+
}

packages/smithy-core/src/smithy_core/aio/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,7 @@ async def _handle_attempt[I: SerializeableShape, O: DeserializeableShape](
469469
)
470470
except Exception as e:
471471
if isinstance(e, self.transport.TIMEOUT_EXCEPTIONS):
472-
raise ClientTimeoutError(
473-
message=f"Client timeout occurred: {e}"
474-
) from e
472+
raise ClientTimeoutError(message="A timeout error occurred.") from e
475473
raise
476474

477475
_LOGGER.debug("Received response: %s", transport_response)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "enhancement",
3+
"description": "Improved error messaging for CRT-based timeout errors."
4+
}

packages/smithy-http/src/smithy_http/aio/crt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async def send(
187187
return await self._await_response(crt_stream)
188188
except AwsCrtError as e:
189189
if e.name in self._TIMEOUT_ERROR_NAMES:
190-
raise _CRTTimeoutError() from e
190+
raise _CRTTimeoutError(f"CRT {e.name}: {e.message}") from e
191191
raise
192192

193193
async def _await_response(

0 commit comments

Comments
 (0)