File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -357,11 +357,14 @@ async def exists(
357
357
path
358
358
The path to the file.
359
359
"""
360
- response = await self ._request (
361
- "HEAD" ,
362
- f"/object/info/{ self .id } /{ path } " ,
363
- )
364
- return response .status_code == 200
360
+ try :
361
+ response = await self ._request (
362
+ "HEAD" ,
363
+ f"/object/{ self .id } /{ path } " ,
364
+ )
365
+ return response .status_code == 200
366
+ except json .JSONDecodeError :
367
+ return False
365
368
366
369
async def list (
367
370
self ,
Original file line number Diff line number Diff line change @@ -357,11 +357,14 @@ def exists(
357
357
path
358
358
The path to the file.
359
359
"""
360
- response = self ._request (
361
- "HEAD" ,
362
- f"/object/info/{ self .id } /{ path } " ,
363
- )
364
- return response .status_code == 200
360
+ try :
361
+ response = self ._request (
362
+ "HEAD" ,
363
+ f"/object/{ self .id } /{ path } " ,
364
+ )
365
+ return response .status_code == 200
366
+ except json .JSONDecodeError :
367
+ return False
365
368
366
369
def list (
367
370
self ,
You can’t perform that action at this time.
0 commit comments