Enhance API client error messages#1791
Conversation
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>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1791 +/- ##
=======================================
Coverage 75.12% 75.12%
=======================================
Files 84 84
Lines 11922 11922
=======================================
Hits 8956 8956
Misses 2966 2966
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot Please add single apostrophe quotes around all variables in the error messages for consistency |
|
@CodyCBakerPhD I've opened a new pull request, #1798, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
Only one minor gripe above otherwise more words to read when something fails |
| "api_url and dandi_instance are mutually exclusive. " | ||
| "Use either 'api_url' to specify a custom API URL, " |
There was a problem hiding this comment.
More inconsistency to fix in follow-up
|
No code changes. Only text. Latest text reads well and adds more detail |
|
@copilot Need to fix various test outputs that utilize the altered error messages |
|
@CodyCBakerPhD I've opened a new pull request, #1801, to work on those changes. Once the pull request is ready, I'll request review from you. |
Update test assertions for enhanced API error messages
Improves API client error messages with clearer guidance for troubleshooting access issues.
Changes
dandi lscommand and includes version contextExample Improvements
Before:
After:
Benefits
Files Changed
dandi/dandiapi.pyTesting
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