Skip to content

fix: add error messages for empty or failed exports (fixes #15)#17

Open
anjalichhikara-0907 wants to merge 1 commit intocdli-gh:masterfrom
anjalichhikara-0907:fix/error-message-empty-download
Open

fix: add error messages for empty or failed exports (fixes #15)#17
anjalichhikara-0907 wants to merge 1 commit intocdli-gh:masterfrom
anjalichhikara-0907:fix/error-message-empty-download

Conversation

@anjalichhikara-0907
Copy link

Problem

When running cdli export --format atf --entities artifacts, the export
silently returns an empty file with no feedback to the user. This is
confusing as users don't know if the command failed or succeeded.

Changes

  • Added a check for when no entities are specified, with a clear error message
  • Improved error reporting by using process.stderr.write directly for
    better visibility
  • Added a summary error message when all exports fail, explaining possible
    causes
  • Added a helpful note suggesting alternative formats like 'ndjson', 'csv',
    or 'ntriples' when atf export fails

Testing

Run the following to reproduce the original issue and verify the fix:

cdli export --host https://cdli.earth/ --entities artifacts --format atf

Before fix: silent empty download
After fix: clear error message with guidance on correct formats

Related

Fixes #15

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error message instead of empty download

1 participant