-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(curated-recommendations): [MC-1270] handle graphql errors and re…
…factor retry logic (#621) * [MC-1270] feat: Handle curated-corpus-api GraphQL errors * Fix linting errors in tests * Update merino/curated_recommendations/corpus_backends/corpus_api_backend.py Co-authored-by: Mathijs Miermans <[email protected]> * Update the fetch() function to throw an exception if GraphQL error occurs * Replace integration test for GraphQL error with the one Mathijs outlined * Update new test name * Fix test * replace the integration test rather than create a new, very similar one * Fix linting errors * feat(curated-recommendations) [MC-1270]: handle GraphQL errors and refactor retries - tenacity is used to retry the corpus api response, replacing custom retry code. - `CorpusGraphQLError` is raised when a GraphQL error is received. --------- Co-authored-by: Nina Pypchenko <[email protected]>
- Loading branch information
Showing
8 changed files
with
197 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"data": null, | ||
"errors": [ | ||
{ | ||
"message": "Could not find Scheduled Surface with id of \"NEW_TAB_EN_UX\".", | ||
"locations": [ | ||
{ | ||
"line": 1, | ||
"column": 79 | ||
} | ||
], | ||
"path": [ | ||
"scheduledSurface" | ||
], | ||
"extensions": { | ||
"code": "BAD_USER_INPUT" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.