summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-01-12 21:21:33 +0000
committersr55 <[email protected]>2017-01-12 21:21:33 +0000
commit1ff916a4f3d1031f38d5e0dfa64877f2e0407970 (patch)
tree2fe3c2ddcad132194de2fd7b588a43cce82a1d40 /win/CS/HandBrakeWPF/Services
parentcd858bced3ec13da9ff25d935b8c5166ad9a60b7 (diff)
WinGui: Put up a clearer error when we can't read older presets rather than just showing a stack trace. #513
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index 6869b89a2..78387e54e 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -142,11 +142,20 @@ namespace HandBrakeWPF.Services.Presets
{
if (!string.IsNullOrEmpty(filename))
{
- PresetTransportContainer container = HandBrakePresetService.GetPresetFromFile(filename);
+ PresetTransportContainer container = null;
+ try
+ {
+ container = HandBrakePresetService.GetPresetFromFile(filename);
+ }
+ catch (Exception exc)
+ {
+ this.errorService.ShowError(Resources.Main_PresetImportFailed, Resources.Main_PresetImportFailedSolution, exc);
+ return;
+ }
if (container?.PresetList == null || container.PresetList.Count == 0)
{
- this.errorService.ShowError(Resources.Main_PresetImportFailed, Resources.Main_PresetImportFailedSolution, string.Empty);
+ this.errorService.ShowError(Resources.Main_PresetImportFailed, Resources.Main_PresetImportFailedSolution, Resources.NoAdditionalInformation);
return;
}