Skip to content

Commit 04867d4

Browse files
committed
Expose connection errors in httpfs.exists
1 parent ac7031b commit 04867d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fsspec/implementations/http.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ async def gen_chunks():
316316
async with meth(self.encode_url(rpath), data=gen_chunks(), **kw) as resp:
317317
self._raise_not_found_for_status(resp, rpath)
318318

319-
async def _exists(self, path, **kwargs):
319+
async def _exists(self, path, strict=False, **kwargs):
320320
kw = self.kwargs.copy()
321321
kw.update(kwargs)
322322
try:
@@ -326,7 +326,10 @@ async def _exists(self, path, **kwargs):
326326
async with r:
327327
return r.status < 400
328328
except aiohttp.ClientError:
329-
return False
329+
if strict:
330+
raise
331+
else:
332+
return False
330333

331334
async def _isfile(self, path, **kwargs):
332335
return await self._exists(path, **kwargs)

0 commit comments

Comments
 (0)