mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #162] [MERGED] [downloader] Fix failure diagnostics: exit codes, tracebacks, timeout messages #163
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/162
Author: @Glitchy-Sheep
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/19/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/failure-diagnostics📝 Commits (3)
3f27ca3fix: Make --post-url failures visible in the exit code4a17180fix: Translate every yt-dlp failure into an application error11d2006fix: Diagnose a mid-download network timeout as a timeout📊 Changes
9 files changed (+301 additions, -45 deletions)
View changed files
📝
CHANGELOG.md(+6 -0)📝
boosty_downloader/src/application/use_cases/download_single_post.py(+7 -4)📝
boosty_downloader/src/application/use_cases/download_specific_post.py(+11 -24)📝
boosty_downloader/src/cli/commands/download.py(+7 -3)📝
boosty_downloader/src/infrastructure/external_videos_downloader/external_videos_downloader.py(+5 -7)📝
boosty_downloader/src/infrastructure/file_downloader.py(+6 -2)➕
test/unit/file_downloader/timeout_diagnosis_test.py(+106 -0)📝
test/unit/use_cases/download_specific_post_test.py(+56 -5)➕
test/unit/use_cases/ext_video_errors_test.py(+97 -0)📄 Description
[downloader] Fix failure diagnostics: exit codes, tracebacks, timeout messages
Summary
Three user-facing bugs found by the architecture research sweep, fixed in one PR - all three are about the same theme: when something fails, the app must say so honestly.
Problems and fixes
1.
--post-urlreported every failure as success.boosty-downloader download -p <url> && echo okprintedokon a dead link, a missing post, a paywalled post - and even on Ctrl+C. The use case computed an outcome and threw it away. Now the outcome reaches the CLI: failures exit with code 1, Ctrl+C propagates to the top-level handler and exits 130, same as bulk runs. The private duplicated outcome enum is gone - both paths sharePostOutcome.2. A removed or restricted external video crashed the run with a raw traceback. The yt-dlp wrapper raised the bare
ExtVideoErrorbase class, but the error translation caught only its subclasses - the most common failure (video deleted, geo-blocked) flew past the whole error model. The raise site now uses the specificExtVideoDownloadError, the translation catches the base as a safety net for future kinds, and the base class carriesvideo_urlso the failed log always names the video.3. A network timeout mid-download was reported as "Failed during I/O operation". The timeout branch was dead code - it caught an exception nothing raises - so a
sock_readtimeout fell into the disk-failure diagnosis and sent users checking their drive instead of their network. Real timeouts (including aiohttp'sSocketTimeoutError, which inherits from both the timeout and connection families) now map to "Download timed out: the server stopped sending data", placed before the connection branch so the right family wins.Verification
task cigreen: checks, 174 unit tests + 1 strict xfail (10 new tests across the three fixes), e2e, build🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.