Skip to content

Conversation

@yarikoptic-gitmate
Copy link
Collaborator

Improves upload and download error messages with diagnostic hints for quick issue resolution.

Changes

  • File not found: Adds file path context
  • Failed validation: References dandi validate command for details
  • Failed to compute digest: Suggests checking file readability and corruption
  • Failed to extract metadata: Explains NWB specification requirements
  • No URLs provided: Shows example usage for download command

Example Improvements

Before:

NotImplementedError: No URLs were provided. Cannot download anything

After:

NotImplementedError: No URLs were provided. Cannot download anything.
Provide a DANDI URL (e.g., 'dandi download DANDI:000027')
or use '--download' with a dandiset URL.

Benefits

  • Users get specific guidance for upload/download issues
  • References validation commands for more details
  • Provides example usage

Files Changed

  • dandi/upload.py
  • dandi/download.py

Testing

Verified with full test suite: 548 passed, 0 failed.

Note: This PR may have minor conflicts with # if that hasn't merged yet. Both add docstrings and improve errors in upload.py/download.py but in different parts of the files.

See commit: 64a04262

Co-Authored-By: Claude Sonnet 4.5 [email protected]

Improve error messages in upload.py and download.py to provide clearer guidance:
- Add file path context to "File not found" errors
- Reference 'dandi validate' command for validation failures
- Suggest checking file format and corruption for digest errors
- Explain NWB specification requirements for metadata extraction
- Provide example usage for download command when no URLs given

These improvements help users quickly diagnose and fix upload/download issues.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@yarikoptic-gitmate yarikoptic-gitmate added enhancement New feature or request UX labels Feb 12, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.10%. Comparing base (a3dd9f9) to head (a631c58).

Files with missing lines Patch % Lines
dandi/upload.py 25.00% 3 Missing ⚠️
dandi/download.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
- Coverage   75.11%   75.10%   -0.01%     
==========================================
  Files          84       84              
  Lines       11921    11921              
==========================================
- Hits         8954     8953       -1     
- Misses       2967     2968       +1     
Flag Coverage Δ
unittests 75.10% <20.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants