Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the Fetcher API #211

Merged
merged 1 commit into from
Aug 9, 2017
Merged

Conversation

bryankane
Copy link
Contributor

@bryankane bryankane commented Aug 9, 2017

This change refactors the fetcher to simplify the implementation and return more information about downstream errors.

  • Removes the concept of TopLevelRequest, instead turning the Fetcher into an implementation that only makes one request given a ResourceName and arguments. Initially, the plan was to allow the fetcher to make multiple requests at once, but that is not a priority anymore due to the engine refactor.
  • Removes models that are no longer used
  • Modifies the UrlLogging middleware to become a ResponseMetadata middleware, including the sourceUrl as well as response codes and error messages.

We can now get nice error responses like this:
screen shot 2017-08-09 at 2 44 58 pm

This change refactors the fetcher to simplify the implementation and return more information about downstream errors.
- Removes the concept of `TopLevelRequest`, instead turning the Fetcher into an implementation that only makes one request given a `ResourceName` and arguments. Initially, the plan was to allow the fetcher to make multiple requests at once, but that is not a priority anymore due to the engine refactor.
- Removes models that are no longer used
- Modifies the UrlLogging middleware to become a ResponseMetadata middleware, including the sourceUrl as well as response codes and error messages.
Copy link
Contributor

@vishalkuo vishalkuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bryankane bryankane merged commit df441b9 into coursera:master Aug 9, 2017
@bryankane bryankane deleted the fetcher-refactor branch August 9, 2017 23:20
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.

None yet

2 participants