MangaBaka: handle 404 cover image fetch gracefully#302
Open
gregoryn22 wants to merge 1 commit intoSnd-R:masterfrom
Open
MangaBaka: handle 404 cover image fetch gracefully#302gregoryn22 wants to merge 1 commit intoSnd-R:masterfrom
gregoryn22 wants to merge 1 commit intoSnd-R:masterfrom
Conversation
MangaBaka's image CDN can return 404 for cover URLs that are present in the API response. Previously this caused the entire identify/match operation to fail with an unhandled ClientRequestException. Now a 404 is caught and logged as a warning, and metadata is returned without a cover image rather than aborting the operation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When MangaBaka's CDN returns a 404 for a cover image URL that is present in the API response,
fetchCover()throws an unhandledClientRequestException. This exception propagates up throughgetSeriesMetadata()/matchSeriesMetadata(), causing the entire identify/match operation to fail even though the series metadata was fetched successfully.This is a real-world reliability issue: MangaBaka sometimes includes cover URLs in API responses that no longer resolve (returning 404 + a PNG error body). The metadata itself is valid — only the artwork is missing.
Fix
Wrap the HTTP request in
fetchCover()with atry/catchonClientRequestException. On a 404 response:null(metadata is returned without a cover)Any other HTTP error is re-thrown as before.
This mirrors the existing pattern in
ComicVineMetadataProvider.getCover(), which already handles 404s this way.Before / After
Before:
After:
Notes
AniList,BookWalker,Bangumi,MAL) have similar unguarded image fetches, but that's out of scope for this PR. This change targets the immediate reported issue.getSeriesCover()is also protected by this fix, so a standalone cover refresh on a broken URL will also fail gracefully.