File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33import aiohttp
44import asyncio
55import backoff
6+ import socket
67
78from .base import BaseDownloader , DownloadResult
89from pulpcore .exceptions import (
@@ -272,7 +273,7 @@ async def download_wrapper():
272273 e .message ,
273274 )
274275 )
275- raise e
276+ raise ProxyAuthenticationRequiredError ( self . proxy )
276277
277278 return await download_wrapper ()
278279
@@ -299,10 +300,11 @@ async def _run(self, extra_data=None):
299300 self .raise_for_status (response )
300301 to_return = await self ._handle_response (response )
301302 await response .release ()
302- except aiohttp .ClientConnectorDNSError :
303- raise DnsDomainNameException (self .url )
304- except aiohttp .ClientHttpProxyError :
305- raise ProxyAuthenticationRequiredError (self .proxy )
303+ except aiohttp .ClientConnectorError as e :
304+ # Check if this is a DNS error
305+ if isinstance (e .os_error , socket .gaierror ):
306+ raise DnsDomainNameException (self .url )
307+ raise
306308 if self ._close_session_on_finalize :
307309 await self .session .close ()
308310 return to_return
You can’t perform that action at this time.
0 commit comments