Skip to content

Fix error handling inconsistency in TMDB service#4

Open
dillonvargo wants to merge 1 commit into
mainfrom
devin/1757630434-fix-tmdb-error-handling
Open

Fix error handling inconsistency in TMDB service#4
dillonvargo wants to merge 1 commit into
mainfrom
devin/1757630434-fix-tmdb-error-handling

Conversation

@dillonvargo

Copy link
Copy Markdown
Owner

Fix error handling inconsistency in TMDB service

Summary

Fixed error handling inconsistency where getMovieDetails and getMoviesByGenre functions threw errors instead of providing fallback data like other TMDB service functions. This change prevents the app from crashing when the TMDB API is unavailable, particularly in ResultScreen.js where getMovieDetails is used in Promise.all.

Key Changes:

  • Added getFallbackMovieDetails() function that provides fallback movie data with required runtime and genres fields
  • Updated getMovieDetails() to return fallback data instead of throwing errors
  • Updated getMoviesByGenre() to return fallback data instead of throwing errors
  • Now follows the same error handling pattern used by getTopRatedMovies() and getMovieGenres()

Review & Testing Checklist for Human

  • Test ResultScreen with API failures: Simulate TMDB API failure (disconnect network/block requests) and verify the Results screen still displays movie matches using fallback data instead of crashing
  • Verify fallback data structure: Ensure the fallback movie details include all expected fields (id, title, overview, posterUrl, releaseDate, voteAverage, runtime, genres) and match the format expected by UI components
  • Review default values: Check that the hardcoded fallback values (120 minutes runtime, 'Drama' genre) are reasonable defaults for the user experience

Notes

  • The fallback values chosen (120 min runtime, 'Drama' genre) are arbitrary defaults that maintain data structure consistency
  • This change affects how the app behaves during API outages - it will now gracefully degrade instead of showing error states
  • Pattern now matches other TMDB functions that already use fallback data

Link to Devin run: https://app.devin.ai/sessions/997c56473ff4496c886e49224b75c7cf
Requested by: @dillonvargo

- Add getFallbackMovieDetails function with runtime and genres fields
- Update getMovieDetails to return fallback data instead of throwing errors
- Update getMoviesByGenre to return fallback data instead of throwing errors
- Ensures consistent error handling pattern across all TMDB service functions
- Prevents app crashes when TMDB API is unavailable

Co-Authored-By: Dillon Vargo <dillonvargo@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify

netlify Bot commented Sep 11, 2025

Copy link
Copy Markdown

Deploy Preview for match-n-munch ready!

Name Link
🔨 Latest commit 14ea336
🔍 Latest deploy log https://app.netlify.com/projects/match-n-munch/deploys/68c350c9303c47000873e364
😎 Deploy Preview https://deploy-preview-4--match-n-munch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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