Fix error handling inconsistency in TMDB service#4
Open
dillonvargo wants to merge 1 commit into
Open
Conversation
- 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>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for match-n-munch ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Fix error handling inconsistency in TMDB service
Summary
Fixed error handling inconsistency where
getMovieDetailsandgetMoviesByGenrefunctions 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 inResultScreen.jswheregetMovieDetailsis used inPromise.all.Key Changes:
getFallbackMovieDetails()function that provides fallback movie data with requiredruntimeandgenresfieldsgetMovieDetails()to return fallback data instead of throwing errorsgetMoviesByGenre()to return fallback data instead of throwing errorsgetTopRatedMovies()andgetMovieGenres()Review & Testing Checklist for Human
id,title,overview,posterUrl,releaseDate,voteAverage,runtime,genres) and match the format expected by UI componentsNotes
Link to Devin run: https://app.devin.ai/sessions/997c56473ff4496c886e49224b75c7cf
Requested by: @dillonvargo