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

Surface errors when loading PR details. #1059

Merged
merged 3 commits into from Jul 14, 2017

Conversation

Projects
None yet
3 participants
@grokys
Contributor

grokys commented Jul 12, 2017

When an error occurs loading PR details, currently the spinner just spins forever with no indication of an error. This PR adds a simple error display to the view which can easily be reused by other views.

  • Added a new IHasErrorState interface for view models
  • Updated ViewBase to track the IHasErrorState.ErrorMessage property and display the error message when non-null
  • Catch exceptions when loading PullRequestDetailsViewModel

To test:

  • Run the extension and load the PR list
  • Run fiddler and set up an autoresponder to respond with an error for requests to api.github.com
  • Click to open a PR

Currently looks like this:

image

Could probably do with some beautification!

Not addressed in this PR

  • Showing a "Retry" button on network error
  • Showing a "Login" button on auth error

These are rather more involved and so will be addressed in another PR.

Fixes #1049

Display errors loading PR details.
- Added a new `IHasErrorState` interface for view models
- Updated ViewBase to track the `IHasErrorState.ErrorMessage` property and display the error message when non-null
- Catch exceptions when loading `PullRequestDetailsViewModel`

@grokys grokys requested review from donokuda, paladique and jcansdale Jul 12, 2017

@jcansdale

I was able to test by loading the PR list, turning off WiFi and clicking on a PR. The following message appeared.

image

It's nice to see when something has gone wrong.

@grokys grokys merged commit d9116de into master Jul 14, 2017

5 checks passed

GitHub CLA @grokys has accepted the GitHub Contributor License Agreement.
Details
VisualStudio Build #7288556 succeeded in 94s
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
jenkins/build_log Jenkins Build Log
Details

@grokys grokys deleted the fixes/1049-surface-pr-errors branch Jul 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment