Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions datamint/api/endpoints/resources_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ async def _upload_single_resource_async(self,
else:
source_filepath = os.path.abspath(os.path.expanduser(file_path))
filename = os.path.basename(source_filepath)
if not os.path.exists(file_path):
raise FileNotFoundError(f"File not found: {file_path}")

if session is not None and not isinstance(session, aiohttp.ClientSession):
raise ValueError("session must be an aiohttp.ClientSession object.")
Expand Down
4 changes: 4 additions & 0 deletions datamint/client_cmd_tools/datamint_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ def walk_to_depth(path: str | Path,
if _is_system_file(child):
continue

if child.is_symlink() and not child.exists():
_USER_LOGGER.warning(f"Skipping broken symlink: {child}")
continue

if child.is_dir():
if depth != 0:
if exclude_pattern is not None and fnmatch.fnmatch(child.name, exclude_pattern):
Expand Down
Loading