@@ -391,9 +391,16 @@ private ContextMenu CreateContextMenuForUnstagedChanges(ViewModels.WorkingCopy v
391391 options . DefaultExtension = ".patch" ;
392392 options . FileTypeChoices = [ new FilePickerFileType ( "Patch File" ) { Patterns = [ "*.patch" ] } ] ;
393393
394- var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
395- if ( storageFile != null )
396- await vm . SaveChangesToPatchAsync ( selectedUnstaged , true , storageFile . Path . LocalPath ) ;
394+ try
395+ {
396+ var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
397+ if ( storageFile != null )
398+ await vm . SaveChangesToPatchAsync ( selectedUnstaged , true , storageFile . Path . LocalPath ) ;
399+ }
400+ catch ( Exception exception )
401+ {
402+ App . RaiseException ( repo . FullPath , $ "Failed to save as patch: { exception . Message } ") ;
403+ }
397404
398405 e . Handled = true ;
399406 } ;
@@ -788,9 +795,16 @@ private ContextMenu CreateContextMenuForUnstagedChanges(ViewModels.WorkingCopy v
788795 options . DefaultExtension = ".patch" ;
789796 options . FileTypeChoices = [ new FilePickerFileType ( "Patch File" ) { Patterns = [ "*.patch" ] } ] ;
790797
791- var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
792- if ( storageFile != null )
793- await vm . SaveChangesToPatchAsync ( selectedUnstaged , true , storageFile . Path . LocalPath ) ;
798+ try
799+ {
800+ var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
801+ if ( storageFile != null )
802+ await vm . SaveChangesToPatchAsync ( selectedUnstaged , true , storageFile . Path . LocalPath ) ;
803+ }
804+ catch ( Exception exception )
805+ {
806+ App . RaiseException ( repo . FullPath , $ "Failed to save as patch: { exception . Message } ") ;
807+ }
794808
795809 e . Handled = true ;
796810 } ;
@@ -975,9 +989,16 @@ public ContextMenu CreateContextMenuForStagedChanges(ViewModels.WorkingCopy vm,
975989 options . DefaultExtension = ".patch" ;
976990 options . FileTypeChoices = [ new FilePickerFileType ( "Patch File" ) { Patterns = [ "*.patch" ] } ] ;
977991
978- var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
979- if ( storageFile != null )
980- await vm . SaveChangesToPatchAsync ( selectedStaged , false , storageFile . Path . LocalPath ) ;
992+ try
993+ {
994+ var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
995+ if ( storageFile != null )
996+ await vm . SaveChangesToPatchAsync ( selectedStaged , false , storageFile . Path . LocalPath ) ;
997+ }
998+ catch ( Exception exception )
999+ {
1000+ App . RaiseException ( repo . FullPath , $ "Failed to save as patch: { exception . Message } ") ;
1001+ }
9811002
9821003 e . Handled = true ;
9831004 } ;
@@ -1183,9 +1204,16 @@ public ContextMenu CreateContextMenuForStagedChanges(ViewModels.WorkingCopy vm,
11831204 options . DefaultExtension = ".patch" ;
11841205 options . FileTypeChoices = [ new FilePickerFileType ( "Patch File" ) { Patterns = [ "*.patch" ] } ] ;
11851206
1186- var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
1187- if ( storageFile != null )
1188- await vm . SaveChangesToPatchAsync ( selectedStaged , false , storageFile . Path . LocalPath ) ;
1207+ try
1208+ {
1209+ var storageFile = await storageProvider . SaveFilePickerAsync ( options ) ;
1210+ if ( storageFile != null )
1211+ await vm . SaveChangesToPatchAsync ( selectedStaged , false , storageFile . Path . LocalPath ) ;
1212+ }
1213+ catch ( Exception exception )
1214+ {
1215+ App . RaiseException ( repo . FullPath , $ "Failed to save as patch: { exception . Message } ") ;
1216+ }
11891217
11901218 e . Handled = true ;
11911219 } ;
0 commit comments