From b8ee41991cb6e93d2cf9222fc13b0fd4277fdf70 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 7 Oct 2012 20:42:45 +0000 Subject: WinGui: Fix a couple of swallowed exceptions. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5009 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Services/Base/EncodeBase.cs | 13 ++++++++----- .../HandBrake.ApplicationServices/Services/ScanService.cs | 12 ++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs index 6a9717ef8..8cca6e7e5 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs @@ -72,7 +72,6 @@ namespace HandBrake.ApplicationServices.Services.Base GeneralUtilities.CreateCliLogHeader( userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeVersion), userSettingService.GetUserSetting(ASUserSettingConstants.HandBrakeBuild)); - } #region Events @@ -265,7 +264,7 @@ namespace HandBrake.ApplicationServices.Services.Base try { - string query = QueryGeneratorUtility.GenerateQuery(new EncodeTask(encodeQueueTask.Task), + string query = QueryGeneratorUtility.GenerateQuery(new EncodeTask(encodeQueueTask.Task), userSettingService.GetUserSetting(ASUserSettingConstants.PreviewScanCount), userSettingService.GetUserSetting(ASUserSettingConstants.Verbosity), userSettingService.GetUserSetting(ASUserSettingConstants.DisableLibDvdNav)); @@ -330,13 +329,17 @@ namespace HandBrake.ApplicationServices.Services.Base if (this.fileWriter.BaseStream.Length > 100000000) { this.Stop( - new Exception( - "The encode has been stopped. The log file has grown to over 100MB which indicates a serious problem has occured with the encode." + - "Please check the encode log for an indication of what the problem is.")); + new GeneralApplicationException( + "The encode has been stopped. The log file has grown to over 100MB which indicates a serious problem has occured with the encode.", + "Please check the encode log for an indication of what the problem is.", null)); } } } } + catch (GeneralApplicationException) + { + throw; + } catch (Exception exc) { // Do Nothing. diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index acfb4d6d6..bb4ec44c6 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -319,8 +319,8 @@ namespace HandBrake.ApplicationServices.Services } else { - throw new Exception( - "The Log file has not been written to disk as it has grown above the 50MB limit. This indicates there was a problem during the scan process."); + throw new GeneralApplicationException( + "The Log file has not been written to disk as it has grown above the 50MB limit", " This indicates there was a problem during the scan process.", null); } } @@ -330,7 +330,7 @@ namespace HandBrake.ApplicationServices.Services if (postScanAction != null) { postScanAction(true); - } + } else { if (this.ScanCompleted != null) @@ -339,6 +339,10 @@ namespace HandBrake.ApplicationServices.Services } } } + catch (GeneralApplicationException) + { + throw; + } catch (Exception exc) { this.Stop(); @@ -356,7 +360,7 @@ namespace HandBrake.ApplicationServices.Services } } } - + /// /// Fire an event when the scan process progresses /// -- cgit v1.2.3