diff --git a/aiohttp/client.py b/aiohttp/client.py index 4bc6f75a8c4..64301357ae4 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -415,7 +415,7 @@ async def _request( try: url = self._build_url(str_or_url) except ValueError as e: - raise + raise InvalidUrlClientError(str_or_url) from e if url.scheme not in HTTP_SCHEMA_SET: