feat: enhance file upload handling and response normalization in virtual file system

This commit is contained in:
shiyu
2026-01-18 15:14:25 +08:00
parent 31d347d24f
commit 4f86e2da4d
5 changed files with 98 additions and 19 deletions

View File

@@ -225,7 +225,10 @@ class VirtualFSListingMixin(VirtualFSResolverMixin):
stat_func = getattr(adapter_instance, "stat_file", None)
if not callable(stat_func):
raise HTTPException(501, detail="Adapter does not implement stat_file")
info = await stat_func(root, rel)
try:
info = await stat_func(root, rel)
except FileNotFoundError as exc:
raise HTTPException(404, detail=str(exc))
if isinstance(info, dict):
info.setdefault("path", path)