Skip to content

fix: stop silently swallowing exceptions in indexer search methods - #249

Merged
RicherTunes merged 1 commit into
mainfrom
fix/indexer-error-propagation
Mar 27, 2026
Merged

RicherTunes merged 1 commit into
mainfrom
fix/indexer-error-propagation

Conversation

@RicherTunes

Copy link
Copy Markdown
Owner

Summary

  • SearchAlbumsAsync, SearchTracksInternalAsync, GetAlbumDetailsInternalAsync, and SearchEnhancedAsync previously caught exceptions, reported them via bridge reporters, then returned empty results ([] or a default StreamingAlbum). This silently hid API failures, auth errors, and rate limits from callers -- Lidarr would show zero results with no indication anything went wrong.
  • All four methods now rethrow after reporting through IIndexerStatusReporter, so callers (Lidarr) can surface errors to users and apply retry logic.
  • GetAlbumDetailsInternalAsync also gains IIndexerStatusReporter.ReportErrorAsync calls in its catch block (previously it only logged) and SearchEnhancedAsync gains the same reporter integration for consistency.
  • The happy path is completely unchanged. Bridge reporter calls are preserved.
  • The null-mapping fallback in GetAlbumDetailsInternalAsync is moved inside the try block since it is only needed when the API call succeeds but mapping returns null -- it should not mask exceptions.

Test plan

  • All 649 tests pass (0 new failures introduced; 61 pre-existing HostBridge FV 9.0 assembly failures identical to main)
  • No existing tests assert empty-result-on-error for the changed methods
  • Verify Lidarr surfaces indexer errors in the UI when Tidal API is unreachable
  • Verify rate limit errors from Tidal propagate to Lidarr's retry logic

🤖 Generated with Claude Code

…lowing

The indexer's SearchAlbumsAsync, SearchTracksInternalAsync,
GetAlbumDetailsInternalAsync, and SearchEnhancedAsync methods caught
exceptions, reported them via bridge reporters, then returned empty
results. This silently hid failures from callers — Lidarr would show
zero results with no indication that an error occurred.

After this change, all four methods still report errors through the
bridge reporters (IIndexerStatusReporter) but rethrow instead of
returning empty collections. This lets Lidarr surface auth failures,
rate limits, and API errors to users. The happy path is unchanged.

GetAlbumDetailsInternalAsync also gains bridge reporter calls in its
catch block (previously only logged) and SearchEnhancedAsync gains the
same reporter integration for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RicherTunes
RicherTunes merged commit 449d31c into main Mar 27, 2026
0 of 12 checks passed
@RicherTunes
RicherTunes deleted the fix/indexer-error-propagation branch May 27, 2026 17:14
RicherTunes added a commit that referenced this pull request May 28, 2026
fix: stop silently swallowing exceptions in indexer search methods
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