Skip to content

Conversation

Copy link

Copilot AI commented Jan 24, 2026

The download command returns exit code 0 even when errors are logged, preventing scripts from detecting failures when using --ignore-errors.

Changes

  • Error tracking: Added _errors counter to DownloadCounter class with count_error() method
  • Error capture points:
    • consume(): exceptions during async download tasks
    • download_cover(): missing cover URLs
    • ASIN/title lookup failures
  • Exit code: Return 1 when counter.errors > 0 at end of download command

Behavior

# Before: exit 0 despite errors
$ audible download --aaxc --asin INVALID --ignore-errors
ERROR: Skip asin INVALID: Not found in library
$ echo $?
0

# After: exit 1 signals failure
$ audible download --aaxc --asin INVALID --ignore-errors
ERROR: Skip asin INVALID: Not found in library
$ echo $?
1

Without --ignore-errors, behavior unchanged (exception → exit 1/2). Successful downloads still exit 0.

Original prompt

This section details on the original issue you should resolve

<issue_title>Exitcodes: Non-0 exitcode for runs with errors</issue_title>
<issue_description>Hi!

I am using audible-cli in a bunch of scripts. Sometimes downloads are not possible and error out.

When that happens, i do get a log-line "Error: xyz", but the exit code is still 0.

It would be helpful for scripting if the errorcode could convey more information about that. I'd like a non-zero errorcode at the minimum if errors did occur at all.

Thanks!</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 24, 2026 20:50
Co-authored-by: mkb79 <40368641+mkb79@users.noreply.github.com>
Co-authored-by: mkb79 <40368641+mkb79@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix non-zero exit code for downloads with errors Return non-zero exit code when download errors occur with --ignore-errors Jan 24, 2026
Copilot AI requested a review from mkb79 January 24, 2026 20:56
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.

Exitcodes: Non-0 exitcode for runs with errors

2 participants