1616using GitHub . UI ;
1717using LibGit2Sharp ;
1818using ReactiveUI ;
19+ using NLog ;
1920
2021namespace GitHub . ViewModels
2122{
@@ -26,6 +27,8 @@ namespace GitHub.ViewModels
2627 [ PartCreationPolicy ( CreationPolicy . NonShared ) ]
2728 public class PullRequestDetailViewModel : PanePageViewModelBase , IPullRequestDetailViewModel
2829 {
30+ static readonly Logger log = LogManager . GetCurrentClassLogger ( ) ;
31+
2932 readonly IModelService modelService ;
3033 readonly IPullRequestService pullRequestsService ;
3134 readonly IPullRequestSessionManager sessionManager ;
@@ -93,7 +96,7 @@ public PullRequestDetailViewModel(
9396 Checkout = ReactiveCommand . CreateAsyncObservable (
9497 this . WhenAnyValue ( x => x . CheckoutState )
9598 . Cast < CheckoutCommandState > ( )
96- . Select ( x => x != null && x . IsEnabled ) ,
99+ . Select ( x => x != null && x . IsEnabled ) ,
97100 DoCheckout ) ;
98101 Checkout . IsExecuting . Subscribe ( x => isInCheckout = x ) ;
99102 SubscribeOperationError ( Checkout ) ;
@@ -351,6 +354,7 @@ public override void Initialize(ViewWithData data)
351354 . ObserveOn ( RxApp . MainThreadScheduler )
352355 . Catch < IPullRequestModel , Exception > ( ex =>
353356 {
357+ log . Error ( "Error observing GetPullRequest" , ex ) ;
354358 ErrorMessage = ex . Message . Trim ( ) ;
355359 IsLoading = IsBusy = false ;
356360 return Observable . Empty < IPullRequestModel > ( ) ;
@@ -460,6 +464,7 @@ public async Task Load(IRemoteRepositoryModel remoteRepository, IPullRequestMode
460464 }
461465 catch ( Exception ex )
462466 {
467+ log . Error ( "Error loading PullRequestModel" , ex ) ;
463468 ErrorMessage = ex . Message . Trim ( ) ;
464469 }
465470 finally
0 commit comments