Skip to content

Conversation

@yarikoptic-gitmate
Copy link
Collaborator

Improves API client error messages with clearer guidance for troubleshooting access issues.

Changes

  • Mutually exclusive parameters: Explains proper usage of api_url vs dandi_instance
  • Dandiset not found: Suggests verifying ID, checking permissions, and provides web UI link
  • Asset not found: References dandi ls command and includes version context

Example Improvements

Before:

NotFoundError: No asset at path 'data/file.nwb'

After:

NotFoundError: No asset at path 'data/file.nwb' in version draft.
Verify the path is correct and the asset exists in this version.
Use 'dandi ls' to list available assets.

Benefits

  • Clearer guidance for API access issues
  • References specific commands for troubleshooting
  • Includes version context to help users understand scope

Files Changed

  • dandi/dandiapi.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 dandiapi.py but in different parts of the file.

See commit: cea29d0c

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Improve error messages in dandiapi.py to provide clearer guidance:
- Explain mutually exclusive api_url/dandi_instance parameters
- Add hint to verify Dandiset ID and check permissions
- Reference 'dandi ls' command for listing assets
- Include version context in "No asset at path" errors

These improvements help users quickly troubleshoot API access issues.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@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 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.44%. Comparing base (a3dd9f9) to head (30450c9).

Files with missing lines Patch % Lines
dandi/dandiapi.py 0.00% 4 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a3dd9f9) and HEAD (30450c9). Click for more details.

HEAD has 333 uploads less than BASE
Flag BASE (a3dd9f9) HEAD (30450c9)
unittests 349 16
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1791       +/-   ##
===========================================
- Coverage   75.11%   50.44%   -24.68%     
===========================================
  Files          84       84               
  Lines       11921    11921               
===========================================
- Hits         8954     6013     -2941     
- Misses       2967     5908     +2941     
Flag Coverage Δ
unittests 50.44% <0.00%> (-24.68%) ⬇️

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