Skip to content

MangaBaka: handle 404 cover image fetch gracefully#302

Open
gregoryn22 wants to merge 1 commit intoSnd-R:masterfrom
gregoryn22:claude/naughty-wright-33903c
Open

MangaBaka: handle 404 cover image fetch gracefully#302
gregoryn22 wants to merge 1 commit intoSnd-R:masterfrom
gregoryn22:claude/naughty-wright-33903c

Conversation

@gregoryn22
Copy link
Copy Markdown
Contributor

Problem

When MangaBaka's CDN returns a 404 for a cover image URL that is present in the API response, fetchCover() throws an unhandled ClientRequestException. This exception propagates up through getSeriesMetadata() / 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 a try/catch on ClientRequestException. On a 404 response:

  • Log a warning with the series title and status code
  • Return 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:

Fetch metadata ✅ → Fetch cover image → 404 → uncaught exception → entire identify fails ❌

After:

Fetch metadata ✅ → Fetch cover image → 404 → warn + return null → metadata returned without cover ✅

Notes

  • Other providers (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.

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>
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.

1 participant